You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2020/11/11 14:28:43 UTC
[incubator-superset] branch master updated: fix(chart-data): ignore
orderby on sample result type (#11656)
This is an automated email from the ASF dual-hosted git repository.
villebro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new 77dff0e fix(chart-data): ignore orderby on sample result type (#11656)
77dff0e is described below
commit 77dff0e4e0e717e5d878708ba639428aecca3f2f
Author: Ville Brofeldt <33...@users.noreply.github.com>
AuthorDate: Wed Nov 11 16:27:56 2020 +0200
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 350243c..a9aa56e 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 fc1b8ce..3881e57 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,