From 77dff0e4e0e717e5d878708ba639428aecca3f2f Mon Sep 17 00:00:00 2001 From: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Date: Wed, 11 Nov 2020 16:27:56 +0200 Subject: [PATCH] fix(chart-data): ignore orderby on sample result type (#11656) --- superset/common/query_context.py | 1 + tests/fixtures/query_context.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/common/query_context.py b/superset/common/query_context.py index 350243c3b..a9aa56ed5 100644 --- a/superset/common/query_context.py +++ b/superset/common/query_context.py @@ -148,6 +148,7 @@ class QueryContext: if self.result_type == utils.ChartDataResultType.SAMPLES: row_limit = query_obj.row_limit or math.inf query_obj = copy.copy(query_obj) + query_obj.orderby = [] query_obj.groupby = [] query_obj.metrics = [] query_obj.post_processing = [] diff --git a/tests/fixtures/query_context.py b/tests/fixtures/query_context.py index fc1b8ce9c..3881e5764 100644 --- a/tests/fixtures/query_context.py +++ b/tests/fixtures/query_context.py @@ -25,7 +25,7 @@ QUERY_OBJECTS = { "is_timeseries": False, "metrics": [{"label": "sum__num"}], "order_desc": True, - "orderby": [], + "orderby": [["sum__num", False]], "row_limit": 100, "time_range": "100 years ago : now", "timeseries_limit": 0,