Open binbinlv opened 1 month ago
And the error message for JSON datatype is the same:
pymilvus.exceptions.ParamError: <ParamError: (code=1, message=Default value unsupported data type: 999)>
reproduced script:
from pymilvus import CollectionSchema, FieldSchema
from pymilvus import Collection
from pymilvus import connections
from pymilvus import DataType
from pymilvus import Partition
from pymilvus import utility
import json
import random
connections.connect()
dim = 3
schema = CollectionSchema(fields=[
FieldSchema(name="id", dtype=DataType.INT64, is_primary=True, auto_id=False),
FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=3),
FieldSchema(name="flat", dtype=DataType.INT64, default_value=100),
FieldSchema(name="json", dtype=DataType.JSON, default_value={"value": 100})
])
collection = Collection("test_binbin_123", schema=schema)
I think the error message is better to be something like "Default value unsupported data type: its DataType info"
And when default_value=100 for ARRAY field, the error message is misleading too. results:
code=1100, message=default value type mismatches field schema type: invalid parameter[expected=DataType_Int64][actual=not match]
Reproduced script:
from pymilvus import CollectionSchema, FieldSchema
from pymilvus import Collection
from pymilvus import connections
from pymilvus import DataType
from pymilvus import Partition
from pymilvus import utility
import json
import random
connections.connect()
dim = 3
schema = CollectionSchema(fields=[
FieldSchema(name="id", dtype=DataType.INT64, is_primary=True, auto_id=False),
FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=3),
FieldSchema(name="flat", dtype=DataType.INT64, default_value=100),
FieldSchema(name="array", dtype=DataType.ARRAY, element_type=DataType.INT64, max_capacity=100, default_value=100)
])
collection = Collection("test_binbin_123", schema=schema)
And this issue exists in vector field: (1) FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=3, default_value=10):
code=1100, message=default value type mismatches field schema type: invalid parameter[expected=DataType_Int64][actual=not match])>
(2) FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=3, default_value=[1, 2, 3])
(code=1, message=Default value unsupported data type: 999)
And this issue exists in vector field: (1) FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=3, default_value=10):
code=1100, message=default value type mismatches field schema type: invalid parameter[expected=DataType_Int64][actual=not match])>
(2) FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=3, default_value=[1, 2, 3])
(code=1, message=Default value unsupported data type: 999)
datatype:999 means unknown. Maybe we can also do some type error in pymilvus later. Anyway, in #36840, I have made some improvements about others.
Fixed error:
when default_value=100 for ARRAY field: new error message:
code=1100, message=type not support default_value, type:Array, name:array: invalid parameter
when default_value=100 for Vector field: new error message:
code=1100, message=type not support default_value, type:FloatVector, name:vector: invalid parameter
unfixed error:
code=1, message=Default value unsupported data type: 999
And this issue exists in vector field: (1) FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=3, default_value=10):
code=1100, message=default value type mismatches field schema type: invalid parameter[expected=DataType_Int64][actual=not match])>
(2) FieldSchema(name="vector", dtype=DataType.FLOAT_VECTOR, dim=3, default_value=[1, 2, 3])
(code=1, message=Default value unsupported data type: 999)
datatype:999 means unknown. Maybe we can also do some type error in pymilvus later. Anyway, in #36840, I have made some improvements about others.
Maybe we could report "Default value unsupported data type: [ARRAY, JSON, FLOAT_VECTOR...] " here list all the unsupported field type for default value?
Is there an existing issue for this?
Environment
Current Behavior
The error message is not clear when set default value to ARRAY type field
Expected Behavior
something like "Default value unsupported data type: ARRAY"
Steps To Reproduce
Milvus Log
No response
Anything else?
No response