Skip to content

fix: report partition_names in validation errors instead of the internal key - #3763

Open
sainikhiljuluri wants to merge 1 commit into
milvus-io:masterfrom
sainikhiljuluri:fix/2589-report-public-partition-names-param
Open

fix: report partition_names in validation errors instead of the internal key#3763
sainikhiljuluri wants to merge 1 commit into
milvus-io:masterfrom
sainikhiljuluri:fix/2589-report-public-partition-names-param

Conversation

@sainikhiljuluri

Copy link
Copy Markdown

Problem

check_pass_param was called with the internal key partition_name_array, and _raise_param_error (check.py:261) formats the registry key straight into the message. So an invalid value reported a parameter name that appears nowhere in the public API:

>>> client.hybrid_search("coll", reqs, rerank, partition_names=1)
ParamError: `partition_name_array` value 1 is illegal

There is no partition_name_array argument to look up.

Fix

Register the validator under partition_names and pass that name from the 10 internal call sites. partition_name_array stays registered, so anything still passing it keeps being validated rather than tripping the unknown param branch.

Production change is a pure rename plus one registry line — no validation behaviour changes.

Tests

make unittest4541 passed, 3 skipped (baseline 4536; +5 new). make lint clean.

  • TestLoadPartitionsRequest in tests/unit/prepare/test_collection.py goes through the real path (Prepare.load_partitions) and asserts the message names partition_names. Reverting the call site makes it fail with `partition_name_array` value ['p1', 1] is illegal — the bug itself, not a setup error.
  • TestPartitionNamesErrorMessage in tests/unit/test_client_validators.py covers the registry directly, including that the old key still validates.

Fixes #2589

…nal key

check_pass_param was called with the internal key partition_name_array, and
_raise_param_error formats the registry key straight into the message, so an
invalid value reported a parameter name that appears nowhere in the public API:

    `partition_name_array` value 1 is illegal

Register the validator under partition_names and pass that name from the call
sites. The old key stays registered so anything still passing it keeps being
validated.

Fixes milvus-io#2589

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Sainikhil Juluri <sainikhiljuluri19008@gmail.com>
@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sainikhiljuluri
To complete the pull request process, please assign xuanyang-cn after the PR has been reviewed.
You can assign the PR to them by writing /assign @xuanyang-cn in a comment when ready.

The full list of commands accepted by this bot can be found 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

@sre-ci-robot

Copy link
Copy Markdown

Welcome @sainikhiljuluri! It looks like this is your first PR to milvus-io/pymilvus 🎉

@mergify

mergify Bot commented Aug 16, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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.

[Bug]: [milvus_client_p2] The parameter "partition_names" of "hybrid_search" in error message is "partition_name_array"

2 participants