From 5b5e3618408c1e0a6125e34ba14210e1ca351b72 Mon Sep 17 00:00:00 2001 From: "zhenshan.cao" Date: Tue, 5 Mar 2024 17:38:52 +0800 Subject: [PATCH] Fix bug: add enable_dynamic_field in result of DescribeCollection (#1949) Signed-off-by: zhenshan.cao --- pymilvus/client/abstract.py | 3 +-- pymilvus/orm/schema.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pymilvus/client/abstract.py b/pymilvus/client/abstract.py index 6acbb6934..fbec16917 100644 --- a/pymilvus/client/abstract.py +++ b/pymilvus/client/abstract.py @@ -173,9 +173,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 diff --git a/pymilvus/orm/schema.py b/pymilvus/orm/schema.py index 6ae6a568f..5cbc0be9b 100644 --- a/pymilvus/orm/schema.py +++ b/pymilvus/orm/schema.py @@ -238,7 +238,7 @@ def to_dict(self): "description": self._description, "fields": [s.to_dict() for s in self._fields], } - if self._enable_dynamic_field: + if self._enable_dynamic_field is not None: _dict["enable_dynamic_field"] = self._enable_dynamic_field return _dict