-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling NULL values in Filters #825
Conversation
@@ -177,7 +177,7 @@ def get_df(self, query_obj=None): | |||
if self.datasource.offset: | |||
df.timestamp += timedelta(hours=self.datasource.offset) | |||
df.replace([np.inf, -np.inf], np.nan) | |||
df = df.fillna(0) | |||
df = df.fillna('NULL') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this main create some problems where there's missing data expected to be numeric. Ultimately we want javascript's reserved null
in the json. Would df.fillna(None)
work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
df.fillna(None) threw an error 'must specify a fill method or value'
But I get your point - if ('NULL') is treated as true in javascript. we may need some similar handling in javascript (like value=='NULL'?value:null).
Side note - should this fillna be done only for Dimensions and skip Metrics ?
@mistercrunch I've been testing lot of visualizations with this fix, no issues are found. |
After recent changes to chart controls in Superset, some typing has become obsolete. Let's clean it up.
After recent changes to chart controls in Superset, some typing has become obsolete. Let's clean it up.
After recent changes to chart controls in Superset, some typing has become obsolete. Let's clean it up.
After recent changes to chart controls in Superset, some typing has become obsolete. Let's clean it up.
As of now, we can not add Filter to express that value of dimension is NULL.
Adding null in filterbox is considered for searching for literal string 'NULL'.
Addresses Issue: #663
Also displaying NULL values as NULL (instead of 0) as per @x4base suggestion.