Skip to content

Commit 70118a4

Browse files
authored
fix: remove duplicate field name check in pymilvus (#2294)
this check was added in #2257. this caused an test in milvus to fail. the test expects the error to be thrown on server side instead of sdk side. it is ok to check on sdk side but I choose to remove it to keep the behavior consistent and comfort the ut without modifying it. Failed test: https://github.com/milvus-io/milvus/blob/5b2658327d676453e8a251ffc3273f4a218fb278/tests/python_client/testcases/test_collection.py#L318 Signed-off-by: Buqian Zheng <[email protected]>
1 parent 077a045 commit 70118a4

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

pymilvus/exceptions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ class ExceptionsMessage:
227227
FunctionIncorrectType = "The function of schema type must be Function."
228228
FieldType = "The field of schema type must be FieldSchema."
229229
FieldDtype = "Field dtype must be of DataType"
230-
FieldNamesDuplicate = "Duplicate field names are not allowed."
231230
ExprType = "The type of expr must be string ,but %r is given."
232231
EnvConfigErr = "Environment variable %s has a wrong format, please check it: %s"
233232
AmbiguousIndexName = "There are multiple indexes, please specify the index_name."

pymilvus/orm/schema.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ def _check_fields(self):
140140
primary_field_name = self._kwargs.get("primary_field", None)
141141
partition_key_field_name = self._kwargs.get("partition_key_field", None)
142142
clustering_key_field_name = self._kwargs.get("clustering_key_field", None)
143-
field_names = [field.name for field in self._fields]
144-
if len(field_names) != len(set(field_names)):
145-
raise ParamError(message=ExceptionsMessage.FieldNamesDuplicate)
146143
for field in self._fields:
147144
if primary_field_name and primary_field_name == field.name:
148145
field.is_primary = True

0 commit comments

Comments
 (0)