Repository navigation
Conversation
…ing matched With no instance shared between the element and the table, `_get_masked_element` passed `None` to `.loc` for points (KeyError: None), kept every element row for `match_rows="left"`, and `_match_rows` read `.iloc[0]` of an empty merge for `match_rows="right"` (IndexError). Return an empty element in all three cases. Closes scverse#1226
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1312 +/- ##
=======================================
Coverage 91.43% 91.43%
=======================================
Files 53 53
Lines 8395 8395
=======================================
Hits 7676 7676
Misses 719 719
🚀 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.
Closes #1226.
#1266 fixed the left join when the element and the table share no instance. The other join types still broke in that case:
innerorrightjoin (match_rows="no"or"left"):KeyError: None, because_get_masked_elementpassedNoneto.locfor dask framesinnerjoin withmatch_rows="left": no error, but the element kept all its rows next to a 0-row tableinnerorrightjoin withmatch_rows="right":IndexErrorfrom.iloc[0]on the empty merge in_match_rows_get_masked_elementnow uses an empty array instead ofNonewhen nothing matches, so the existing ordering code and.lochandle that case for shapes and points alike._match_rowsreturns empty indices for an empty merge.The new test runs every
how×match_rowscombination for shapes and points against a table that shares no instance with the element; 9 of the 30 cases fail onmain. The results now match the docstring ofjoin_spatialelement_table:leftkeeps the element and returns a 0-row table,innerreturns an empty element and a 0-row table,rightreturns an empty element and the full table.