Skip to content

fix: preserve top-level type params in FieldSchema.construct_from_dict - #3766

Open
mameikagou wants to merge 3 commits into
milvus-io:masterfrom
mameikagou:fix/field-schema-top-level-params
Open

fix: preserve top-level type params in FieldSchema.construct_from_dict#3766
mameikagou wants to merge 3 commits into
milvus-io:masterfrom
mameikagou:fix/field-schema-top-level-params

Conversation

@mameikagou

Copy link
Copy Markdown

What

FieldSchema.construct_from_dict() currently reads type parameters only from the nested params mapping. Dictionaries that provide max_length or dim at the top level therefore lose those values, so the reconstructed VARCHAR or vector field is incomplete.

This preserves top-level max_length and dim while keeping the canonical nested params value authoritative when both forms are present. Explicit top-level None values 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.py
  • ruff check pymilvus/orm/schema.py tests/unit/orm/test_schema.py

Signed-off-by: mameikagou <mrlonely1226@163.com>
@sre-ci-robot

Copy link
Copy Markdown

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

@mergify mergify Bot added the dco-passed label Aug 20, 2026
@mameikagou
mameikagou marked this pull request as ready for review August 21, 2026 06:18
@mameikagou

Copy link
Copy Markdown
Author

/assign @XuanYang-cn

@mergify

mergify Bot commented Aug 21, 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

Comment thread pymilvus/orm/schema.py Outdated
@sre-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mameikagou
To complete the pull request process, please ask for approval from xuanyang-cn after the PR has been reviewed.

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

@mergify mergify Bot added needs-dco and removed dco-passed labels Aug 21, 2026
Signed-off-by: mameikagou <mrlonely1226@163.com>
@mameikagou
mameikagou force-pushed the fix/field-schema-top-level-params branch from cfa81bf to 26310b7 Compare August 21, 2026 15:19
@mergify mergify Bot added dco-passed and removed needs-dco labels Aug 21, 2026
Comment thread pymilvus/orm/schema.py Outdated
@mergify mergify Bot added needs-dco and removed dco-passed labels Aug 27, 2026
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.22%. Comparing base (64e53d1) to head (4006b1c).

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.
📢 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 Aug 28, 2026
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]: FieldSchema.construct_from_dict() not support params max_length and dim

4 participants