You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jo...@apache.org on 2020/01/28 01:24:14 UTC

[incubator-superset] 01/01: [fix] Reverting metic logic from #8901

This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a commit to branch john-bodley--fix-regression-8901
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit 34ec3b1b0f3edf94f40f4b317aac0b0a9ea0b1d6
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Mon Jan 27 17:23:58 2020 -0800

    [fix] Reverting metic logic from #8901
---
 superset/common/query_object.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/superset/common/query_object.py b/superset/common/query_object.py
index dad50ea..68c9b0e 100644
--- a/superset/common/query_object.py
+++ b/superset/common/query_object.py
@@ -81,7 +81,14 @@ class QueryObject:
         self.time_shift = utils.parse_human_timedelta(time_shift)
         self.groupby = groupby or []
 
-        self.metrics = [utils.get_metric_name(metric) for metric in metrics]
+        # Temporal solution for backward compatability issue due the new format of
+        # non-ad-hoc metric which needs to adhere to superset-ui per
+        # https://git.io/Jvm7P.
+        self.metrics = [	
+            metric if "expressionType" in metric else metric["label"]  # type: ignore	
+            for metric in metrics
+        ]
+        
         self.row_limit = row_limit
         self.filter = filters or []
         self.timeseries_limit = timeseries_limit