You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/05/14 19:38:44 UTC

[GitHub] mistercrunch commented on a change in pull request #4914: Make MetricsControl the standard across visualizations

mistercrunch commented on a change in pull request #4914: Make MetricsControl the standard across visualizations
URL: https://github.com/apache/incubator-superset/pull/4914#discussion_r188072710
 
 

 ##########
 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:
   It's a bit complex here as many controls may use `MetricControl` (some with non null validators, some without) and we don't want to duplicate logic. In the context above `metrics` may exist as a key or not exist, or have `None`, `[]` or an actual list of values OR dicts. That first step here is to remove `None` or key doesn't exist from the list of possibility as it should be treated the same.
   
   There's clearly much that could be done with a stronger contract between the backend and the frontend.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org