Skip to content

Commit

Permalink
fix: remove duplicate field name check in pymilvus (#2294)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
zhengbuqian authored Oct 12, 2024
1 parent 077a045 commit 70118a4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion pymilvus/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ class ExceptionsMessage:
FunctionIncorrectType = "The function of schema type must be Function."
FieldType = "The field of schema type must be FieldSchema."
FieldDtype = "Field dtype must be of DataType"
FieldNamesDuplicate = "Duplicate field names are not allowed."
ExprType = "The type of expr must be string ,but %r is given."
EnvConfigErr = "Environment variable %s has a wrong format, please check it: %s"
AmbiguousIndexName = "There are multiple indexes, please specify the index_name."
Expand Down
3 changes: 0 additions & 3 deletions pymilvus/orm/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ def _check_fields(self):
primary_field_name = self._kwargs.get("primary_field", None)
partition_key_field_name = self._kwargs.get("partition_key_field", None)
clustering_key_field_name = self._kwargs.get("clustering_key_field", None)
field_names = [field.name for field in self._fields]
if len(field_names) != len(set(field_names)):
raise ParamError(message=ExceptionsMessage.FieldNamesDuplicate)
for field in self._fields:
if primary_field_name and primary_field_name == field.name:
field.is_primary = True
Expand Down

0 comments on commit 70118a4

Please sign in to comment.