Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] get word_cloud to support complex metrics #5248

Merged
merged 1 commit into from
Jun 22, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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