From f52eefa1d09759603057208f3020c85310f4134b Mon Sep 17 00:00:00 2001 From: smellthemoon <64083300+smellthemoon@users.noreply.github.com> Date: Thu, 19 Oct 2023 15:03:59 +0800 Subject: [PATCH] Fix describe miss some params (#1742) Signed-off-by: lixinguo Co-authored-by: lixinguo --- pymilvus/client/abstract.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/pymilvus/client/abstract.py b/pymilvus/client/abstract.py index 7c954c028..7672b278f 100644 --- a/pymilvus/client/abstract.py +++ b/pymilvus/client/abstract.py @@ -72,25 +72,19 @@ def __pack(self, raw: Any): self.indexes.extend([index_dict]) def dict(self): - _dict = { + return { "field_id": self.field_id, "name": self.name, "description": self.description, "type": self.type, "params": self.params or {}, "element_type": self.element_type, + "is_primary": self.is_primary, + "auto_id": self.auto_id, + "is_partition_key": self.is_partition_key, + "is_dynamic": self.is_dynamic, } - if self.is_partition_key: - _dict["is_partition_key"] = True - if self.is_dynamic: - _dict["is_dynamic"] = True - if self.auto_id: - _dict["auto_id"] = True - if self.is_primary: - _dict["is_primary"] = self.is_primary - return _dict - class CollectionSchema: def __init__(self, raw: Any): @@ -168,9 +162,8 @@ def dict(self): "consistency_level": self.consistency_level, "properties": self.properties, "num_partitions": self.num_partitions, + "enable_dynamic_field": self.enable_dynamic_field, } - if self.enable_dynamic_field: - _dict["enable_dynamic_field"] = self.enable_dynamic_field self._rewrite_schema_dict(_dict) return _dict