feat: apply post processing to chart data (#15843)

* feat: apply post processing to chart data

* Fix tests and lint

* Fix lint

* trigger tests
This commit is contained in:
Beto Dealmeida
2021-07-26 10:58:59 -07:00
committed by GitHub
parent 873daf3867
commit 2f95f81be7
5 changed files with 148 additions and 5 deletions

View File

@@ -1498,6 +1498,7 @@ class TestChartApi(SupersetTestCase, ApiOwnersTestCaseMixin, InsertChartMixin):
class QueryContext:
result_format = ChartDataResultFormat.JSON
result_type = utils.ChartDataResultType.FULL
cmd_run_val = {
"query_context": QueryContext(),
@@ -1508,6 +1509,7 @@ class TestChartApi(SupersetTestCase, ApiOwnersTestCaseMixin, InsertChartMixin):
ChartDataCommand, "run", return_value=cmd_run_val
) as patched_run:
request_payload = get_query_context("birth_names")
request_payload["result_type"] = utils.ChartDataResultType.FULL
rv = self.post_assert_metric(CHART_DATA_URI, request_payload, "post_data")
self.assertEqual(rv.status_code, 200)
data = json.loads(rv.data.decode("utf-8"))