fix: resolve simprint type mismatch in iscc_id queries, cap simprints per type - #5
Open
titusz wants to merge 1 commit into
Open
fix: resolve simprint type mismatch in iscc_id queries, cap simprints per type#5titusz wants to merge 1 commit into
titusz wants to merge 1 commit into
Conversation
… per type search_assets() silently dropped simprints when resolving iscc_id queries because IsccEntry.simprints (IsccSimprint objects) couldn't coerce to IsccQuery.simprints (bare base64 strings). Extract query_from_asset() in common.py to handle the conversion for all three backends. Also add cap_simprints() that randomly samples up to 20 simprints per type to keep search load bounded. Applied in normalize_query() so it covers all query paths. Closes #1
Merged
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
search_assets()silently dropped simprints when resolvingiscc_idqueries due to type mismatch betweenIsccEntry.simprints(IsccSimprintobjects) andIsccQuery.simprints(bare base64 strings). Extractedquery_from_asset()incommon.pyto handle the conversion for all three backends (usearch, lmdb, memory).cap_simprints()that randomly samples up to 20 simprints per type to keep search load bounded. Applied innormalize_query()so it covers all query paths. Logs when capping occurs.Test plan
iscc_idquery on an index with simprint data