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 2019/12/03 04:02:51 UTC

[GitHub] [incubator-superset] john-bodley commented on a change in pull request #8724: handle nulls in bar chart series/breakdown

john-bodley commented on a change in pull request #8724: handle nulls in bar chart series/breakdown
URL: https://github.com/apache/incubator-superset/pull/8724#discussion_r352975382
 
 

 ##########
 File path: superset/viz.py
 ##########
 @@ -1543,10 +1544,15 @@ def query_obj(self):
     def get_data(self, df):
         fd = self.form_data
         metrics = self.metric_labels
+        columns = fd.get("columns") or []
+
+        # pandas will throw away nulls when grouping/pivoting,
+        # so we substitute NULLSTRING for any nulls in the necessary columns
+        filled_cols = self.groupby + columns
+        df[filled_cols] = df[filled_cols].fillna(value=NULLSTRING)
 
 Review comment:
   Can we use `inplace=True` to prevent having to make a copy.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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