Skip to content

Commit

Permalink
Revert "Fixed Histogram visualization bug. (#8077)" (#8145)
Browse files Browse the repository at this point in the history
This reverts commit 7ac1a29.
  • Loading branch information
Erik Ritter authored and villebro committed Sep 8, 2019
1 parent eb3cb95 commit 301211b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -1483,22 +1483,18 @@ def query_obj(self):
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)
Expand Down

0 comments on commit 301211b

Please sign in to comment.