fix(retrieval): skip map-unit count equality on asset filters - #413
Merged
Conversation
Classic image/table queries compared full-revision index.unit_count to the filtered unit subset, so a complete index looked unusable and returned 500. Co-authored-by: Cursor <cursoragent@cursor.com>
…lized local variable' Initialize the revision-inventory flag before the async storage-mismatch branch so CodeQL sees it on every path. Co-authored-by: Cursor <cursoragent@cursor.com>
…lized local variable' Inline the subset-inventory condition so the extra local is gone. CodeQL kept flagging the use of that name even after it was assigned earlier. Co-authored-by: Cursor <cursoragent@cursor.com>
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
indexes.unit_countto the filteredhas_image/has_tableunit subset, so a complete index looked unusable and returned 500.exclude_sectionsuse the same undercount check as unfiltered token projection.RuntimeError, and add mixed-section plus image-filter unusable-index contract coverage.Test plan
chunk_types=image|tablecontract test failed on the old equality check, then passed after the predicate changeuv run pytest apps/api/tests/contract/test_retrieval_classic_map_unit_contract.py -q(15 passed, including unusable-index cases)knowhere-prod-restore-pg: image/table unit counts unequal to fullindexes.unit_count; after the fixmap_unit_discoveryreturneddiscovery_donefor the production image, table, and unfiltered queriesMade with Cursor