fix: resolve bytes vector type misidentification in search path#3291
Open
zhuwenxing wants to merge 5 commits intomilvus-io:masterfrom
Open
fix: resolve bytes vector type misidentification in search path#3291zhuwenxing wants to merge 5 commits intomilvus-io:masterfrom
zhuwenxing wants to merge 5 commits intomilvus-io:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: zhuwenxing The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
7e11bcb to
7dfaca9
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3291 +/- ##
==========================================
+ Coverage 90.04% 90.08% +0.03%
==========================================
Files 64 64
Lines 13638 13680 +42
==========================================
+ Hits 12281 12323 +42
Misses 1357 1357 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8a8d0fe to
a0114e8
Compare
Contributor
|
@zhuwenxing Please fix the conflicts |
When raw bytes are passed as search vectors for float16/bfloat16 fields, _prepare_placeholder_str incorrectly marks them as BinaryVector. Fix by looking up the actual vector type from the collection schema and mapping to the correct PlaceholderType. Fixes milvus-io#3290 Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
Cover the new bytes vector type detection logic in GrpcHandler, AsyncGrpcHandler (search/hybrid_search) and Prepare (schema kwarg resolution), raising patch coverage above the 90% threshold. Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
082ac33 to
64cf079
Compare
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>
Contributor
Author
|
@XuanYang-cn please review |
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
bytesare passed as search vectors for float16/bfloat16 fields,_prepare_placeholder_strincorrectly marks them asBinaryVectorPlaceholderTypeChanges
pymilvus/client/prepare.py: Addvector_data_typeparam to_prepare_placeholder_str, add_get_vector_type_from_schemahelper, pass schema-derived type insearch_requests_with_exprpymilvus/client/grpc_handler.py: Fetch schema when search data contains bytes insearch()andhybrid_search()pymilvus/client/async_grpc_handler.py: Symmetric async modificationstests/prepare/test_search.py: Unit tests for bytes + vector_data_type mapping and schema helperTest plan
pytest tests/prepare/test_search.py(102 passed)Fixes #3290