From 754d6f1a6756f82e3ef2edaf900b220c8dd9bcb2 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Thu, 21 Jun 2018 18:04:56 -0700 Subject: [PATCH] [bugfix] get word_cloud to support complex metrics (#5248) --- superset/viz.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/superset/viz.py b/superset/viz.py index 6b5b68c38f514..cd1170984e325 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -721,14 +721,13 @@ class WordCloudViz(BaseViz): def query_obj(self): d = super(WordCloudViz, self).query_obj() - - d['metrics'] = [self.form_data.get('metric')] d['groupby'] = [self.form_data.get('series')] return d def get_data(self, df): + fd = self.form_data # Ordering the columns - df = df[[self.form_data.get('series'), self.form_data.get('metric')]] + df = df[[fd.get('series'), self.metric_labels[0]]] # Labeling the columns for uniform json schema df.columns = ['text', 'size'] return df.to_dict(orient='records')