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 15:05:30 UTC

[incubator-superset] branch 0.34 updated: Revert "Fixed Histogram visualization bug. (#8077)" (#8145)

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


The following commit(s) were added to refs/heads/0.34 by this push:
     new 301211b  Revert "Fixed Histogram visualization bug.  (#8077)" (#8145)
301211b is described below

commit 301211b5ab06bed3381e364f14cd073501bb3a32
Author: Erik Ritter <er...@airbnb.com>
AuthorDate: Fri Aug 30 14:11:46 2019 -0700

    Revert "Fixed Histogram visualization bug.  (#8077)" (#8145)
    
    This reverts commit 7ac1a290eb013418091a58e92958971348f290e3.
---
 superset/viz.py | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/superset/viz.py b/superset/viz.py
index 5aac00b..cecfe2d 100644
--- a/superset/viz.py
+++ b/superset/viz.py
@@ -1483,22 +1483,18 @@ class HistogramViz(BaseViz):
         numeric_columns = self.form_data.get("all_columns_x")
         if numeric_columns is None:
             raise Exception(_("Must have at least one numeric column specified"))
-        self.columns = [numeric_columns]
-        d["columns"] = [numeric_columns] + self.groupby
+        self.columns = numeric_columns
+        d["columns"] = numeric_columns + self.groupby
         # override groupby entry to avoid aggregation
         d["groupby"] = []
         return d
 
     def labelify(self, keys, column):
-        if isinstance(keys, str) or isinstance(keys, int):
+        if isinstance(keys, str):
             keys = (keys,)
-
         # removing undesirable characters
-        labels = [
-            re.sub(r"\W+", r"_", k) if isinstance(k, str) else str(k) for k in keys
-        ]
-
-        if len(self.columns) > 0 or not self.groupby:
+        labels = [re.sub(r"\W+", r"_", k) for k in keys]
+        if len(self.columns) > 1 or not self.groupby:
             # Only show numeric column in label if there are many
             labels = [column] + labels
         return "__".join(labels)