superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: fix: issues #8041 - bubble support for complex metrics (#8044)
Date Wed, 14 Aug 2019 16:27:36 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin 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 ed8bb1b  fix: issues #8041 - bubble support for complex metrics (#8044)
ed8bb1b is described below

commit ed8bb1b694e95df661bb99ff877097d749a0c9e0
Author: Maxime Beauchemin <maximebeauchemin@gmail.com>
AuthorDate: Wed Aug 14 09:27:18 2019 -0700

    fix: issues #8041 - bubble support for complex metrics (#8044)
---
 superset/viz.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/superset/viz.py b/superset/viz.py
index abd908c..ae4b0a7 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -966,7 +966,9 @@ class BubbleViz(NVD3Viz):
         self.series = form_data.get("series") or self.entity
         d["row_limit"] = form_data.get("limit")
 
-        d["metrics"] = list(set([self.z_metric, self.x_metric, self.y_metric]))
+        d["metrics"] = [self.z_metric, self.x_metric, self.y_metric]
+        if len(set(self.metric_labels)) < 3:
+            raise Exception(_("Please use 3 different metric labels"))
         if not all(d["metrics"] + [self.entity]):
             raise Exception(_("Pick a metric for x, y and size"))
         return d


Mime
View raw message