fix: left join with no matching rows crashed queries on labels - #1266
Open
FarisHrvat wants to merge 1 commit into
Open
FarisHrvat wants to merge 1 commit into
FarisHrvat wants to merge 1 commit into
Conversation
When a queried labels element is annotated by a table but none of its remaining instances are in the table, the left join built a 0-row table and _region_as_str_if_list_of_len_one crashed on the empty region list. Return no table in that case, like the inner and exclusive joins already do. This is the random IndexError in test_attributes_are_copied[labels2d]: the labels come from the shared RNG in conftest, so whether the tiny query box contains an annotated instance depends on test order.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1266 +/- ##
=======================================
Coverage 91.40% 91.40%
=======================================
Files 53 53
Lines 8381 8381
=======================================
Hits 7661 7661
Misses 720 720
🚀 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.
Querying a labels element that is annotated by a table, but whose cropped area contains none of the annotated instances, crashes
polygon_queryandbounding_box_querywithIndexError: list index out of rangein_region_as_str_if_list_of_len_one. The left join builds a 0-row table and then reads the first element of an empty region list.This now returns no table in that case, like the inner and exclusive joins already do, so the query keeps the labels and drops the table.
It's also the random failure of
test_attributes_are_copied[labels2d-*]in the pre-release job on #1265. The labels there come from the sharedRNGinconftest.py, so whether the small query box contains an annotated instance depends on which tests ran before on the same worker. Added a test that builds that case on purpose.