Skip to content

Comments

fix: pass context to describe_collection in SearchIteratorV2#3271

Merged
sre-ci-robot merged 1 commit intomilvus-io:masterfrom
XuanYang-cn:fix3263
Feb 10, 2026
Merged

fix: pass context to describe_collection in SearchIteratorV2#3271
sre-ci-robot merged 1 commit intomilvus-io:masterfrom
XuanYang-cn:fix3263

Conversation

@XuanYang-cn
Copy link
Contributor

Summary

  • Forward **kwargs (which includes context carrying db_name) from SearchIteratorV2.__init__ to _set_up_collection_id and then to describe_collection, matching the existing QueryIterator pattern.
  • Without this fix, SearchIteratorV2 always queries the default database, causing "can't find collection" errors for non-default databases.
  • Added regression test verifying context is properly forwarded.

See also: #3270

Test plan

  • Existing tests/test_search_iterator.py tests pass
  • New test_context_passed_to_describe_collection regression test passes
  • Lint (make lint) passes

🤖 Generated with Claude Code

SearchIteratorV2._set_up_collection_id was not forwarding the context
(which carries db_name) to describe_collection, causing searches on
non-default databases to fail with "can't find collection".

See also: milvus-io#3270

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Signed-off-by: yangxuan <[email protected]>
@sre-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: XuanYang-cn

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@codecov
Copy link

codecov bot commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.36%. Comparing base (eb7868f) to head (29c6cbe).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3271   +/-   ##
=======================================
  Coverage   76.36%   76.36%           
=======================================
  Files          63       63           
  Lines       13321    13321           
=======================================
  Hits        10173    10173           
  Misses       3148     3148           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mergify mergify bot added the ci-passed label Feb 10, 2026
@MrPresent-Han
Copy link
Contributor

/lgtm

@sre-ci-robot sre-ci-robot merged commit f65b888 into milvus-io:master Feb 10, 2026
13 checks passed
@pymilvus-bot
Copy link
Collaborator

Backport Failed
Hi @XuanYang-cn, I could not cherry-pick this to 2.6 due to merge conflicts. Please backport manually.

(cc @MrPresent-Han)

@XuanYang-cn XuanYang-cn deleted the fix3263 branch February 10, 2026 06:49
XuanYang-cn added a commit to XuanYang-cn/pymilvus that referenced this pull request Feb 10, 2026
…io#3271)

- Forward `**kwargs` (which includes `context` carrying `db_name`) from
`SearchIteratorV2.__init__` to `_set_up_collection_id` and then to
`describe_collection`, matching the existing `QueryIterator` pattern.
- Without this fix, `SearchIteratorV2` always queries the `default`
database, causing "can't find collection" errors for non-default
databases.
- Added regression test verifying context is properly forwarded.

See also: milvus-io#3270, milvus-io#3271

- [x] Existing `tests/test_search_iterator.py` tests pass
- [x] New `test_context_passed_to_describe_collection` regression test
passes
- [x] Lint (`make lint`) passes

Signed-off-by: yangxuan <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
@XuanYang-cn XuanYang-cn added PR | cherry-picked to 2.x PR already cherry-picked to branch 2.x and removed backport-to-2.6 labels Feb 10, 2026
sre-ci-robot pushed a commit that referenced this pull request Feb 10, 2026
…3274)

- Forward `**kwargs` (which includes `context` carrying `db_name`) from
`SearchIteratorV2.__init__` to `_set_up_collection_id` and then to
`describe_collection`, matching the existing `QueryIterator` pattern.
- Without this fix, `SearchIteratorV2` always queries the `default`
database, causing "can't find collection" errors for non-default
databases.
- Added regression test verifying context is properly forwarded.

See also: #3270, #3271

- [x] Existing `tests/test_search_iterator.py` tests pass
- [x] New `test_context_passed_to_describe_collection` regression test
passes
- [x] Lint (`make lint`) passes

---------

Signed-off-by: yangxuan <[email protected]>
Co-authored-by: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants