Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: [null & default] Insert rows failed reporting "undefined data type:Int64: invalid parameter" when insert None to nullable field or default value field #36484

Closed
1 task done
binbinlv opened this issue Sep 25, 2024 · 3 comments
Assignees
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@binbinlv
Copy link
Contributor

binbinlv commented Sep 25, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Environment

- Milvus version: master-20240920-6e430bd4
- Deployment mode(standalone or cluster):both
- MQ type(rocksmq, pulsar or kafka):    all
- SDK version(e.g. pymilvus v2.0.0rc2): 2.5.0rc80
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

Insert rows failed reporting "undefined data type:Int64: invalid parameter" when insert None to nullable field or default value field

Expected Behavior

Insert successfully

Steps To Reproduce

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, nullable=True),
])

collection = Collection("test_binbin_123", schema=schema)

collection.insert(data={"id": 4, "vector": [7,8,9], "flat": None})

Milvus Log

No response

Anything else?

No response

@binbinlv binbinlv added kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Sep 25, 2024
@binbinlv binbinlv added this to the 2.5.0 milestone Sep 25, 2024
@smellthemoon
Copy link
Contributor

related with milvus-io/pymilvus#2275. pr merged, could you please check it? @binbinlv

@smellthemoon
Copy link
Contributor

/assign @binbinlv

@binbinlv
Copy link
Contributor Author

Verified and fixed:

pymilvus:2.5.0rc88
milvus: master-20241011-3fe0f829-amd64

results:

>>> 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, nullable=True),
... ])
>>> collection = Collection("test_binbin_1234", schema=schema)
>>> collection.insert(data={"id": 4, "vector": [7,8,9], "flat": None})
(insert count: 1, delete count: 0, upsert count: 0, timestamp: 453149536530726916, success count: 1, err count: 0
>>>
>>>
>>> index_param = {"index_type": "IVF_FLAT", "metric_type": "L2", "params": {"nlist": 100}}
>>> collection.create_index("vector", index_param, index_name="index_name_1")
Status(code=0, message=)
>>> collection.load()
>>> collection.query(expr="id>=0", output_fields=["flat", "vector"])
data: ["{'flat': None, 'vector': [7.0, 8.0, 9.0], 'id': 4}"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Issues or changes related a bug triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

2 participants