Skip to content
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

Merged
merged 1 commit into from May 31, 2018

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented May 30, 2018

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 where NULL or None are handled properly.

Following this simple refactor, we can move forward with more appropriate and per-visualization defined null handling.

@betodealmeida @john-bodley

@codecov-io
Copy link

Codecov Report

Merging #5106 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
superset/viz.py 81.47% <100%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f611797...491ca3b. Read the comment docs.

@@ -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)
Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member Author

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

@hughhhh hughhhh added the lyft Related to Lyft label May 31, 2018
@@ -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
Copy link
Member

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

Copy link
Member Author

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

@hughhhh
Copy link
Member

hughhhh commented May 31, 2018

🚢

@mistercrunch mistercrunch merged commit 2861110 into apache:master May 31, 2018
@mistercrunch mistercrunch deleted the handle_nulls branch May 31, 2018 23:01
timifasubaa pushed a commit to airbnb/superset-fork that referenced this pull request Jul 25, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.26.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels lyft Related to Lyft 🚢 0.26.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants