superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: [bugfix] get word_cloud to support complex metrics (#5248)
Date Fri, 22 Jun 2018 01:04:58 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 5a716e9  [bugfix] get word_cloud to support complex metrics (#5248)
5a716e9 is described below

commit 5a716e99258341b56f51bb97e345da6e62205c41
Author: Maxime Beauchemin <maximebeauchemin@gmail.com>
AuthorDate: Thu Jun 21 18:04:56 2018 -0700

    [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 6b5b68c..cd11709 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')


Mime
View raw message