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 2019/09/08 14:18:34 UTC

[incubator-superset] 03/03: fix: issues #8041 - bubble support for complex metrics (#8044)

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

villebro pushed a commit to branch 0.34
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git

commit eb3cb955747dd4e27ee653faa5b11a835ae4d0b6
Author: Maxime Beauchemin <ma...@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 22b9e72..5aac00b 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