Repository navigation
Conversation
_parse_batch_request built the ParamError message from three f-strings separated by commas, making message a 3-tuple instead of a string. Join them with implicit string concatenation (no commas) so the rendered error is readable text instead of a tuple repr. Fixes milvus-io#3843 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Signed-off-by: Ayush <ayushkc078@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: AyusK4 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 |
|
Welcome @AyusK4! It looks like this is your first PR to milvus-io/pymilvus 🎉 |
|
This pull request is closed, so it cannot be queued. Reopen it to get the box back. |
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
Fixes #3843.
Prepare._parse_batch_request(used bybatch_insert_paramandbatch_upsert_param) raised aParamErrorwhosemessagewas built from three f-strings separated by commas:Because of the commas, this is a 3-tuple literal, not implicit string concatenation, so
messageended up atupleinstead of astr:Removed the commas so the adjacent f-strings concatenate into a single string:
The existing test for this path (
test_field_size_mismatch) only assertedpytest.raises(ParamError, match="misaligned"), which matches againststr(exception)and passed even with the tuple bug — that's why it went unnoticed. Strengthened it to assertmessageis astrwith the exact expected text, so this can't silently regress.Validation
pytest tests/unit/prepare/test_data.py -v -k field_size_mismatch: passes with the new string-equality assertion.pytest tests/unit -q: 5987 passed, 2 skipped, 4 failed — the 4 failures are pre-existing and unrelated (Windows symlink-permission tests intest_volume_upload_policy.pyand a git-metadata check intest_check.py), reproducible onmasterbefore this change.black pymilvus tests --check --diffandruff check pymilvus tests: both clean on the changed files.