Skip to content

Commit

Permalink
Fix default value appear when not set (#1451)
Browse files Browse the repository at this point in the history
Signed-off-by: lixinguo <[email protected]>
Co-authored-by: lixinguo <[email protected]>
  • Loading branch information
smellthemoon and lixinguo authored May 23, 2023
1 parent 16e35e8 commit 69d9b40
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pymilvus/orm/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,11 @@ def construct_from_dict(cls, raw):
if raw.get("auto_id", None) is not None:
kwargs['auto_id'] = raw.get("auto_id", None)
kwargs['is_partition_key'] = raw.get("is_partition_key", False)
kwargs['default_value'] = raw.get("default_value", None)
if isinstance(raw.get("default_value", None), schema_types.ValueField):
kwargs['default_value'] = raw.get("default_value", None)
else:
if raw.get("default_value", None) is not None:
kwargs['default_value'] = None
return FieldSchema(raw['name'], raw['type'], raw.get("description", ""), **kwargs)

def to_dict(self):
Expand Down

0 comments on commit 69d9b40

Please sign in to comment.