-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
Remove the use of Pandas' iloc() in WorldMapViz #7379
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7379 +/- ##
=======================================
Coverage 65.26% 65.26%
=======================================
Files 430 430
Lines 21077 21077
Branches 2338 2338
=======================================
Hits 13756 13756
Misses 7205 7205
Partials 116 116
Continue to review full report at Codecov.
|
5964c5d
to
c171afb
Compare
When the same metric is used in a World Map panel for both bubble size and an axis (either X or Y), it currently breaks the rendering. The change in behavior was introduced in: apache@71e0c07#diff-f451672348fc6071e8d627778bdc4e96L1730 The use of .iloc() is not needed anymore since the code that used to duplicate the metric is not there anymore. Should fix apache#7006
@mistercrunch I think I finally found a good explanation of what broke the world map visualization. The change in my opinion is to remove the use of .iloc, from my tests it is the simplest solution and it solves all my visualization issues. |
@mistercrunch if you have time for a review, I'd be really happy :) |
Pull request opened to upstream: apache#7379
Anybody up for a review? It has been a long time :( |
Does this work when the same metric is used twice? |
I am running superset 0.32 with some extra patches, including this one, and charts using worlmap with the same metric reused as bubble size work fine now. I have checked a couple of times the pandas' changelog to spot any new feature that could have changed its behavior, but found none. After checking git blame for WorldMapViz though, I noticed that the following bit in the commit that I have indicated seems now the responsible for the need of .iloc or not:
|
What version of pandas are you using? Current master says |
I am using 0.23.4 indeed, this is my pip freeze:
|
@mistercrunch there is more context in the related GH issue: #7006 (comment) |
Any news? :) |
@elukey I was able to replicate the problem on master, i.e. when choosing the same metric twice (color and bubble size), the error |
@mistercrunch thoughts? :) |
This commit changed the value of df[metric]
when the same metric is used in a World Map panel for both bubble size
and an axis (either X or Y). This change removes the use of .iloc that is not needed anymore (and causes exceptions while rendering world maps).
Should fix #7006
CATEGORY
Choose one
SUMMARY
WorldMap charts, using the the same metric for X/Y axis and bubble size, are not working anymore from 0.29+ due to commit. If I add the following snipped to the WorldMapViz in superset/viz.py everything works as expected again:
The .iloc functionality in WorldMap is not needed anymore.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TEST PLAN
ADDITIONAL INFORMATION
REVIEWERS