Skip to content

Commit 32301e3

Browse files
authored
Defer check_fields when use milvus_client (#1536)
Signed-off-by: zhenshan.cao <[email protected]>
1 parent e940677 commit 32301e3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pymilvus/milvus_client/milvus_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def create_collection(self,
7272
if "enable_dynamic_field" not in kwargs:
7373
kwargs["enable_dynamic_field"] = True
7474

75-
schema = CollectionSchema([], auto_id=auto_id, **kwargs)
75+
schema = self.create_schema(auto_id=auto_id, **kwargs)
7676

7777
if id_type == "int":
7878
pk_data_type = DataType.INT64
@@ -457,6 +457,7 @@ def drop_collection(self, collection_name: str):
457457

458458
@classmethod
459459
def create_schema(cls, **kwargs):
460+
kwargs["check_fields"] = False # do not check fields for now
460461
return CollectionSchema([], **kwargs)
461462

462463
@classmethod

pymilvus/orm/schema.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ def __init__(self, fields, description="", **kwargs):
6868
raise FieldsTypeException(message=ExceptionsMessage.FieldsType)
6969
self._fields = [copy.deepcopy(field) for field in fields]
7070

71-
self._check()
71+
self._check_kwargs()
72+
if kwargs.get("check_fields", True):
73+
self._check_fields()
74+
7275

7376
def _check_kwargs(self):
7477
primary_field_name = self._kwargs.get("primary_field", None)

0 commit comments

Comments
 (0)