hughhhh commented on a change in pull request #4914: [WiP] make MetricsControl 
the standard across visualizations
URL: 
https://github.com/apache/incubator-superset/pull/4914#discussion_r186552155
 
 

 ##########
 File path: superset/viz.py
 ##########
 @@ -202,7 +222,7 @@ def query_obj(self):
         """Building a query object"""
         form_data = self.form_data
         gb = form_data.get('groupby') or []
-        metrics = form_data.get('metrics') or []
+        metrics = self.all_metrics or []
 
 Review comment:
   I don't like the pattern we currently have for returning empty arrays, i 
feel like we should be throwing some exceptions with the proper messaging to 
let the user know how that there are no metrics currently selected.
   
   For instance if we get `len(self.all_metrics) == 0` or some check we should 
throw a   `SupersetException`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to