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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]