Fix render_points(color="z") silently dropping data column (#615)#667
Open
timtreis wants to merge 1 commit into
Open
Fix render_points(color="z") silently dropping data column (#615)#667timtreis wants to merge 1 commit into
timtreis wants to merge 1 commit into
Conversation
PointsModel.parse silently strips columns whose names collide with reserved spatial-axis names (currently "z"). When _reparse_points re-registered a points element, a data column named "z" requested via color="z" was dropped before color lookup ran, producing a misleading KeyError. _reparse_points now takes the color column name and re-attaches it from the source DataFrame when parsing dropped it, so coloring by a data column that shadows a reserved axis name works.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #667 +/- ##
==========================================
+ Coverage 77.61% 77.63% +0.01%
==========================================
Files 11 11
Lines 3610 3613 +3
Branches 849 850 +1
==========================================
+ Hits 2802 2805 +3
Misses 484 484
Partials 324 324
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PointsModel.parsesilently strips columns whose names collide with reserved spatial-axis names (currently"z"). When_reparse_pointsre-registered the points element, a data column named"z"requested viacolor="z"was dropped before color lookup ran, producing a misleadingKeyError._reparse_pointsnow takes the color column name and re-attaches it from the source DataFrame when parsing dropped it, so coloring by a data column that shadows a reserved axis name works.Fixes #615.
Test plan
test_render_points_color_by_z_data_column— fails onmain, passes on this branch.test_render_points_color_by_z_with_extra_columns— coloring by a non-zcolumn on a frame that also carrieszstill works.tests/pl/suite: 297 passed.