You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/05/11 21:03:39 UTC

[GitHub] [superset] hughhhh commented on a diff in pull request #20014: add form_data with query

hughhhh commented on code in PR #20014:
URL: https://github.com/apache/superset/pull/20014#discussion_r870753068


##########
tests/integration_tests/explore/form_data/api_tests.py:
##########
@@ -89,6 +99,30 @@ def test_post(client, chart_id: int, dataset_id: int):
     assert resp.status_code == 201
 
 
+@pytest.mark.usefixtures("get_query_datasource")
+def test_post_with_query(client, chart_id: int, query_id: int):
+    login(client, "admin")
+    form_data = {
+        "adhoc_filters": [],
+        "viz_type": "sankey",
+        "groupby": ["target"],
+        "metric": "sum__value",
+        "row_limit": 5000,
+        "slice_id": chart_id,
+        "time_range_endpoints": ["inclusive", "exclusive"],
+        "datasource": f"{query_id}__query",
+    }
+    payload = {
+        "datasource_id": query_id,
+        "chart_id": chart_id,
+        "form_data": json.dumps(form_data),
+        "datasource_type": "query",
+    }
+    resp = client.post("api/v1/explore/form_data", json=payload)
+    print(resp.data)

Review Comment:
   remove this



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org