Open qixuan0212 opened 11 hours ago
It is difficult to distinguish between set None and not set here, so no error is reported when the default value is set to none alone. However, if you want to insert none when nullable==false and want the default value to take effect, an error will still be reported. It means that set defaultValue = None is take no effect in restful, which will note in doc.
/assign @qixuan0212
Is there an existing issue for this?
Environment
Current Behavior
If nullable is false and default is set to none, no error message is displayed
Expected Behavior
Restful setting default to none when nullable is false should prompt an error. Report errors like pymilvus:
json_field = FieldSchema(name="json", dtype=DataType.JSON, nullable=False, default_value=None) File "/Users/zilliz/Library/Python/3.9/lib/python/site-packages/pymilvus/orm/schema.py", line 408, in __init__ raise ParamError(message=ExceptionsMessage.DefaultValueInvalid) pymilvus.exceptions.ParamError: <ParamError: (code=1, message=Default value cannot be None for a field that is defined as nullable == false.)>
Steps To Reproduce
Milvus Log
https://grafana-4am.zilliz.cc/explore?orgId=1&panes=%7B%22wIT%22:%7B%22datasource%22:%22vhI6Vw67k%22,%22queries%22:%5B%7B%22refId%22:%22A%22,%22expr%22:%22%7Bcluster%3D%5C%224am%5C%22,namespace%3D%5C%22qa-milvus%5C%22,pod%3D~%5C%22default-none-qx-ykmim.%2A%5C%22%7D%22,%22datasource%22:%7B%22type%22:%22loki%22,%22uid%22:%22vhI6Vw67k%22%7D%7D%5D,%22range%22:%7B%22from%22:%221732245080146%22,%22to%22:%221732245103306%22%7D%7D%7D&schemaVersion=1
Anything else?
N/A