Repository navigation
fix: keep struct params in describe_collection - #3904
Conversation
MilvusClient.describe_collection rebuilt the struct field params from the sub-fields' max_capacity only, so the struct's own params such as mmap_enabled and warmup were dropped. Copy them over before setting max_capacity. Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3904 +/- ##
=======================================
Coverage 94.73% 94.73%
=======================================
Files 81 81
Lines 17102 17105 +3
=======================================
+ Hits 16201 16204 +3
Misses 901 901 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: XuanYang-cn, zhengbuqian The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
✅ Backport Created (cc @XuanYang-cn) |
MilvusClient.describe_collectionconverts each struct array field to the user format withconvert_struct_fields_to_user_format. That function built the struct'sparamsfrom the sub-fields'max_capacityonly and ignored the struct's ownparams. Struct-level properties set at create time, such asmmap_enabledandwarmup, are stored by the server and returned in the describe response (REST v2 describe shows them), but pymilvus dropped them.Changes:
convert_struct_fields_to_user_formatcopies the struct's ownparamsinto the result before settingmax_capacity.Tests: new unit test in
tests/unit/test_utils.py.tests/unitpasses locally (5490 passed, 1 skipped). Checked against a running Milvus: a struct created withmmap_enabled=True, warmup="sync"now describes as{'mmap_enabled': True, 'warmup': 'sync', 'max_capacity': 3}; before the change it was{'max_capacity': 3}.