Skip to content

Align V2 API parity with PyMilvus 2.6 - #2056

Merged
sre-ci-robot merged 1 commit into
milvus-io:2.6from
yhmo:26
Sep 1, 2026
Merged

Align V2 API parity with PyMilvus 2.6#2056
sre-ci-robot merged 1 commit into
milvus-io:2.6from
yhmo:26

Conversation

@yhmo

@yhmo yhmo commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: yhmo

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

@mergify

mergify Bot commented Sep 1, 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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Java V2 SDK to better match PyMilvus 2.6 behavior and request/response parity, adding input validation, new request fields, and expanding returned response metadata.

Changes:

  • Add “no-RPC” fast paths for empty insert/upsert payloads and empty get IDs; reject invalid (non-positive) search limits.
  • Extend utility/RBAC/load APIs with additional fields (dbName, collectionName, targetSizeUnit, priority) and wire them into gRPC requests/responses.
  • Expand and add unit tests to cover the new parity behaviors and request mappings.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
sdk-core/src/test/java/io/milvus/v2/service/vector/VectorTest.java Adds tests for empty insert/upsert/get no-RPC behavior and invalid limit validation.
sdk-core/src/test/java/io/milvus/v2/service/utility/UtilityTest.java Adds tests for listAliases dbName, compact targetSizeUnit conversion + validation, and query segment collectionName.
sdk-core/src/test/java/io/milvus/v2/service/rbac/RoleTest.java Adds tests verifying dbName is propagated in grant/revoke privilege requests.
sdk-core/src/test/java/io/milvus/v2/service/partition/PartitionTest.java Adds test verifying load partition priority is mapped into load params.
sdk-core/src/test/java/io/milvus/v2/service/collection/CollectionTest.java Adds test verifying load collection priority is mapped into load params.
sdk-core/src/test/java/io/milvus/v2/BaseTest.java Extends stub setup for manualCompaction to support new compact tests.
sdk-core/src/main/java/io/milvus/v2/service/vector/VectorService.java Implements empty-data/empty-IDs short-circuits and validates search/hybridSearch limits (sync + async).
sdk-core/src/main/java/io/milvus/v2/service/utility/UtilityService.java Converts compact targetSize based on unit; returns dbName from listAliases; includes collectionName in query segment info.
sdk-core/src/main/java/io/milvus/v2/service/utility/response/ListAliasResp.java Adds dbName field to list aliases response model.
sdk-core/src/main/java/io/milvus/v2/service/utility/response/GetQuerySegmentInfoResp.java Adds collectionName to query segment info model.
sdk-core/src/main/java/io/milvus/v2/service/utility/request/CompactReq.java Adds targetSizeUnit to compact request model (default “mb”).
sdk-core/src/main/java/io/milvus/v2/service/rbac/request/GrantPrivilegeReq.java Adds dbName to grant privilege request model.
sdk-core/src/main/java/io/milvus/v2/service/rbac/RBACService.java Propagates optional dbName into GrantEntity for grant/revoke privilege.
sdk-core/src/main/java/io/milvus/v2/service/partition/request/LoadPartitionsReq.java Adds priority field to load partitions request model.
sdk-core/src/main/java/io/milvus/v2/service/partition/PartitionService.java Maps priority into load params as “load_priority”.
sdk-core/src/main/java/io/milvus/v2/service/collection/request/LoadCollectionReq.java Adds priority field to load collection request model.
sdk-core/src/main/java/io/milvus/v2/service/collection/CollectionService.java Maps priority into load params as “load_priority”.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread sdk-core/src/main/java/io/milvus/v2/service/utility/UtilityService.java Outdated
Comment thread sdk-core/src/main/java/io/milvus/v2/service/utility/UtilityService.java Outdated
@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.62069% with 19 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (2.6@c9dc986). Learn more about missing BASE report.

Files with missing lines Patch % Lines
...ava/io/milvus/v2/service/vector/VectorService.java 86.66% 3 Missing and 1 partial ⚠️
...a/io/milvus/v2/service/utility/UtilityService.java 91.17% 2 Missing and 1 partial ⚠️
.../service/collection/request/LoadCollectionReq.java 66.66% 2 Missing ⚠️
...2/service/partition/request/LoadPartitionsReq.java 66.66% 2 Missing ⚠️
...vus/v2/service/rbac/request/GrantPrivilegeReq.java 66.66% 2 Missing ⚠️
.../milvus/v2/service/utility/request/CompactReq.java 75.00% 2 Missing ⚠️
...vice/utility/response/GetQuerySegmentInfoResp.java 66.66% 2 Missing ⚠️
...vus/v2/service/utility/response/ListAliasResp.java 66.66% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff           @@
##             2.6    #2056   +/-   ##
======================================
  Coverage       ?   63.19%           
  Complexity     ?     3928           
======================================
  Files          ?      427           
  Lines          ?    25021           
  Branches       ?     2446           
======================================
  Hits           ?    15811           
  Misses         ?     7889           
  Partials       ?     1321           
Files with missing lines Coverage Δ
...ilvus/v2/service/collection/CollectionService.java 75.76% <100.00%> (ø)
.../milvus/v2/service/partition/PartitionService.java 90.69% <100.00%> (ø)
...in/java/io/milvus/v2/service/rbac/RBACService.java 81.71% <100.00%> (ø)
.../service/collection/request/LoadCollectionReq.java 72.04% <66.66%> (ø)
...2/service/partition/request/LoadPartitionsReq.java 72.83% <66.66%> (ø)
...vus/v2/service/rbac/request/GrantPrivilegeReq.java 71.42% <66.66%> (ø)
.../milvus/v2/service/utility/request/CompactReq.java 75.00% <75.00%> (ø)
...vice/utility/response/GetQuerySegmentInfoResp.java 71.42% <66.66%> (ø)
...vus/v2/service/utility/response/ListAliasResp.java 75.00% <66.66%> (ø)
...a/io/milvus/v2/service/utility/UtilityService.java 70.58% <91.17%> (ø)
... and 1 more
🚀 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 Sep 1, 2026
Comment thread sdk-core/src/main/java/io/milvus/v2/service/collection/CollectionService.java Outdated
yhmo added a commit to yhmo/milvus-sdk-java that referenced this pull request Sep 1, 2026
Use BigDecimal for overflow-safe target_size to MB conversion and reject
values too small to reach 1 MB. Treat blank/whitespace-only targetSizeUnit
as unset so it defaults to MB. Addresses review comments on PR milvus-io#2056.

Signed-off-by: yhmo <yihua.mo@zilliz.com>
@mergify mergify Bot added ci-passed and removed ci-passed labels Sep 1, 2026
@mergify mergify Bot added ci-passed and removed ci-passed labels Sep 1, 2026
Comment thread sdk-core/src/main/java/io/milvus/v2/service/utility/UtilityService.java Outdated
- load_collection/load_partitions: add priority mapped to load_params[load_priority],
  lowercased to match the proxy's exact-match on 'low'
- compact: add targetSizeUnit (b/kb/mb/gb/tb/pb) with overflow-safe MB conversion
  and rejection of non-positive/too-small/oversize target sizes
- grant/revoke_privilege: map dbName into the V1 OperatePrivilege GrantEntity
- insert/upsert/get: return empty results without issuing an RPC on empty input
- list_aliases: expose dbName; get_query_segment_info: expose collectionName
- search/hybrid_search: reject limit <= 0 (sync and async)

Signed-off-by: yhmo <yihua.mo@zilliz.com>
@mergify mergify Bot added ci-passed and removed ci-passed labels Sep 1, 2026
@yhmo yhmo added the lgtm label Sep 1, 2026
@sre-ci-robot
sre-ci-robot merged commit 5d78e17 into milvus-io:2.6 Sep 1, 2026
8 checks passed
@yhmo
yhmo deleted the 26 branch September 1, 2026 10:23
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.

3 participants