Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
[bugfix] get word_cloud to support complex metrics (apache#5248)
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch authored and timifasubaa committed Jul 25, 2018
1 parent 8ce3850 commit 754d6f1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions superset/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 754d6f1

Please sign in to comment.