Honor explicit table_name= when element has same-named column#666
Merged
Conversation
When `table_name=` was passed to a render function but the element already had a column with the same name, the explicit `table_name` was silently discarded and the element column was used instead. Fix `_validate_col_for_column_table` to only fall back to the element column when no explicit table was requested, and update `_set_color_source_vec` to drop the df origin (and bypass the upstream multi-origin check in `get_values`) when the user has explicitly chosen a table.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #666 +/- ##
=======================================
Coverage 77.61% 77.61%
=======================================
Files 11 11
Lines 3605 3610 +5
Branches 847 849 +2
=======================================
+ Hits 2798 2802 +4
Misses 484 484
- Partials 323 324 +1
🚀 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
Fixes #620.
When the user explicitly passes
table_name=to arender_*function but the element already has a column with the same name, the explicittable_namewas being silently discarded — the element column was used regardless. After this change the explicit choice wins._validate_col_for_column_table: only fall back to the element-column path when no explicittable_namewas requested._set_color_source_vec: when an explicittable_namecauses both an element-df origin and a table origin to match, drop the df origin and pass the table directly aselementto upstreamget_valuesso the multi-origin error is bypassed.tests/pl/test_utils.pycovering both the explicit-table path (legend reflects table values) and the implicit element-column path (unchanged behavior).