Skip to content

Commit

Permalink
fix: not put 'default_value' in dict (#2272)
Browse files Browse the repository at this point in the history
milvus-io/milvus#36457

Signed-off-by: lixinguo <[email protected]>
Co-authored-by: lixinguo <[email protected]>
  • Loading branch information
smellthemoon and lixinguo authored Oct 8, 2024
1 parent da51ba1 commit 24d8bc6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pymilvus/client/abstract.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,19 @@ def __pack(self, raw: Any):
self.indexes.extend([index_dict])

def dict(self):
if self.default_value is not None and self.default_value.WhichOneof("data") is None:
self.default_value = None
_dict = {
"field_id": self.field_id,
"name": self.name,
"description": self.description,
"type": self.type,
"params": self.params or {},
}
if self.default_value is not None:
# default_value is nil match this situation
if self.default_value.WhichOneof("data") is None:
self.default_value = None
else:
_dict["default_value"] = self.default_value

if self.element_type:
_dict["element_type"] = self.element_type
Expand Down

0 comments on commit 24d8bc6

Please sign in to comment.