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

Filter out null locations by default #5642

Merged
merged 4 commits into from
Aug 19, 2018
Merged

Conversation

betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented Aug 15, 2018

I added a checkbox to all spatial visualizations allowing null locations to be filtered out by default. Currently, they are shown as 0, 0, which is confusing.

My original approach to solving this was by filtering the data on viz.py, but at that point we don't know if a zero is a valid location or not (Druid return zeros for null, IIRC). Adding the extra filters to the form data has the benefit that the data is filtered in the database, and in a consistent way.

Here's how the flights dataset currently looks like — note all the arcs with an edge at the Equator/Greenwich:

screen shot 2018-08-15 at 4 04 11 pm

When we toggle "Ignore null locations" they are removed:

screen shot 2018-08-15 at 4 04 20 pm

@codecov-io
Copy link

codecov-io commented Aug 15, 2018

Codecov Report

Merging #5642 into master will decrease coverage by <.01%.
The diff coverage is 94.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5642      +/-   ##
==========================================
- Coverage   63.51%   63.51%   -0.01%     
==========================================
  Files         360      360              
  Lines       22890    22902      +12     
  Branches     2549     2549              
==========================================
+ Hits        14539    14546       +7     
- Misses       8336     8341       +5     
  Partials       15       15
Impacted Files Coverage Δ
superset/assets/src/explore/controls.jsx 45.92% <ø> (ø) ⬆️
superset/assets/src/explore/visTypes.jsx 57.14% <ø> (ø) ⬆️
superset/viz.py 81.35% <94.73%> (+0.09%) ⬆️
superset/views/base.py 68% <0%> (-2.06%) ⬇️
superset/views/core.py 73.93% <0%> (-0.06%) ⬇️
.../assets/src/SqlLab/components/TabbedSqlEditors.jsx 90.99% <0%> (ø) ⬆️

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 5966a67...48fe688. Read the comment docs.

@hughhhh hughhhh self-requested a review August 17, 2018 23:23
superset/viz.py Outdated

# add NULL filters
if fd.get('filter_nulls'):
spatial_columns = set()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get a unit test around this block? Just making sure fd has the proper values

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do! +1

@hughhhh
Copy link
Member

hughhhh commented Aug 19, 2018

🚢

@hughhhh hughhhh merged commit 4c5142d into apache:master Aug 19, 2018
betodealmeida added a commit to lyft/incubator-superset that referenced this pull request Aug 21, 2018
* Filter out null locations by default

* Move exception to better place

* Add unit test

* Return columns in order for test and readibility

(cherry picked from commit 4c5142d)
betodealmeida added a commit to lyft/incubator-superset that referenced this pull request Aug 22, 2018
* Filter out null locations by default

* Move exception to better place

* Add unit test

* Return columns in order for test and readibility

(cherry picked from commit 4c5142d)
betodealmeida added a commit to lyft/incubator-superset that referenced this pull request Aug 22, 2018
* Filter out null locations by default

* Move exception to better place

* Add unit test

* Return columns in order for test and readibility

(cherry picked from commit 4c5142d)
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
* Filter out null locations by default

* Move exception to better place

* Add unit test

* Return columns in order for test and readibility
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.28.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 🚢 0.28.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants