[Bug]: FieldSchema.construct_from_dict() not support params max_length and dim #2046
Open
1 task done
Labels
kind/bug
Something isn't working
Is there an existing issue for this?
Describe the bug
When dict has
max_length
ordim
{'name': 'error_message', 'type': <DataType.VARCHAR: 21>, 'max_length': 1024}
a_dict={'name': 'error_msg_vector', 'type': <DataType.FLOAT_VECTOR: 101>, 'dim': 768}
When I new
FieldSchema.construct_from_dict(a_dict)
, gotTypeError: pymilvus.orm.schema.FieldSchema() got multiple values for keyword argument 'max_length'
and
pymilvus.exceptions.MilvusException: <MilvusException: (code=65535, message=dimension is not defined in field type params, check type param
dimfor vector field)>
Expected Behavior
When I new
FieldSchema.construct_from_dict(a_dict)
no error.Steps/Code To Reproduce behavior
Environment details
Anything else?
add below code at pymilvus/orm/schema.py can fix it.
within def construct_from_dict(cls, raw: Dict):
The text was updated successfully, but these errors were encountered: