fix: preserve top-level type params in FieldSchema.construct_from_dict - #3766
fix: preserve top-level type params in FieldSchema.construct_from_dict#3766mameikagou wants to merge 3 commits into
Conversation
Signed-off-by: mameikagou <mrlonely1226@163.com>
|
Welcome @mameikagou! It looks like this is your first PR to milvus-io/pymilvus 🎉 |
|
/assign @XuanYang-cn |
|
Tick the box to add this pull request to the merge queue (same as
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mameikagou 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 |
Signed-off-by: mameikagou <mrlonely1226@163.com>
cfa81bf to
26310b7
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3766 +/- ##
=======================================
Coverage 94.22% 94.22%
=======================================
Files 77 77
Lines 16204 16207 +3
=======================================
+ Hits 15268 15271 +3
Misses 936 936 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What
FieldSchema.construct_from_dict()currently reads type parameters only from the nestedparamsmapping. Dictionaries that providemax_lengthordimat the top level therefore lose those values, so the reconstructed VARCHAR or vector field is incomplete.This preserves top-level
max_lengthanddimwhile keeping the canonical nestedparamsvalue authoritative when both forms are present. Explicit top-levelNonevalues remain ignored.Fixes #2046
Tests
python -m pytest -q --capture=no tests/unit/orm/test_schema.py(259 passed)black --check pymilvus/orm/schema.py tests/unit/orm/test_schema.pyruff check pymilvus/orm/schema.py tests/unit/orm/test_schema.py