-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Refactor NULL handling into method, disable for DECK.gl vizes #5106
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5106 +/- ##
==========================================
+ Coverage 77.5% 77.51% +0.01%
==========================================
Files 44 44
Lines 8720 8724 +4
==========================================
+ Hits 6758 6762 +4
Misses 1962 1962
Continue to review full report at Codecov.
|
@@ -145,6 +145,10 @@ def run_extra_queries(self): | |||
""" | |||
pass | |||
|
|||
def handle_nulls(self, df): | |||
fillna = self.get_fillna_for_columns(df.columns) | |||
df = df.fillna(fillna) |
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.
Maybe df.fillna(fillna, inplace=True)
.
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's effectively the same, are there perf implications?
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.
Also just moving original code to under a function
@@ -2041,6 +2044,9 @@ class BaseDeckGLViz(BaseViz): | |||
credits = '<a href="https://uber.github.io/deck.gl/">deck.gl</a>' | |||
spatial_control_keys = [] | |||
|
|||
def handle_nulls(self, df): | |||
pass |
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.
let's raise a raise NotImplementedError()
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.
oh here I actually want to do nothing
🚢 |
Moving
handle_nulls
to its own method will allow visualizations to override this part.This specifically turns off null handling for DECK.gl visualizations as there are issues with spatial dimensions getting replaced by
" NULL"
which triggers errors in places whereNULL
orNone
are handled properly.Following this simple refactor, we can move forward with more appropriate and per-visualization defined null handling.
@betodealmeida @john-bodley