xtinec commented on a change in pull request #5902: [refactor] Remove 
dependency on personal fork of supercluster from mapbox visualizations
URL: 
https://github.com/apache/incubator-superset/pull/5902#discussion_r218215236
 
 

 ##########
 File path: superset/viz.py
 ##########
 @@ -1960,7 +1960,7 @@ def get_data(self, df):
             return None
         fd = self.form_data
         label_col = fd.get('mapbox_label')
-        custom_metric = label_col and len(label_col) >= 1
+        custom_metric = bool(label_col) and len(label_col) >= 1
 
 Review comment:
   `custom_metric` is serialized and sent to the client and then used to 
determine how to cluster the incoming data. Without this change, we get `[]` 
when using the default point count for aggregation and `true` when using a 
particular column (e.g. population). The client code is more readable when we 
send a proper boolean as `custom_metric`. I would probably rename this field to 
`has_custom_metric` to reflect its type.
   
   Perhaps I should use `if/else` here to produce a boolean for the client to 
consume?

----------------------------------------------------------------
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