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]: upsert rows when set autoid==true fail #36710

Closed
1 task done
smellthemoon opened this issue Oct 9, 2024 · 11 comments
Closed
1 task done

[Bug]: upsert rows when set autoid==true fail #36710

smellthemoon opened this issue Oct 9, 2024 · 11 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.

Comments

@smellthemoon
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Environment

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

Current Behavior

raise DataNotMatchException(message=ExceptionsMessage.DataTypeInconsistent) from e
pymilvus.exceptions.DataNotMatchException: <DataNotMatchException: (code=1, message=The Input data type is inconsistent with defined schema, please check it.)>

Expected Behavior

No response

Steps To Reproduce

No response

Milvus Log

No response

Anything else?

No response

@smellthemoon smellthemoon added kind/bug Issues or changes related a bug needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 9, 2024
@smellthemoon
Copy link
Contributor Author

/assign

@yanliang567 yanliang567 added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 9, 2024
@yanliang567
Copy link
Contributor

which milvus version are you running?

@yanliang567 yanliang567 removed their assignment Oct 9, 2024
@smellthemoon
Copy link
Contributor Author

which milvus version are you running?

2.4.10

sre-ci-robot pushed a commit to milvus-io/pymilvus that referenced this issue Oct 10, 2024
sre-ci-robot pushed a commit to milvus-io/pymilvus that referenced this issue Oct 10, 2024
@smellthemoon
Copy link
Contributor Author

smellthemoon commented Oct 11, 2024

@yanliang567 could you please help to add some related tests?

@smellthemoon
Copy link
Contributor Author

/assign @yanliang567

@yanliang567
Copy link
Contributor

@smellthemoon could you please share the reproduce code or steps, we already had tests for upsert with autoid==true

@yanliang567
Copy link
Contributor

@smellthemoon did this fix cp to 2.4 branch?

@smellthemoon
Copy link
Contributor Author

@smellthemoon did this fix cp to 2.4 branch?

yes, update pymilvus version to 2.4.13 can fix it. the problem will only occurs when upsert by rows.

@smellthemoon
Copy link
Contributor Author

@smellthemoon could you please share the reproduce code or steps, we already had tests for upsert with autoid==true

import time
import numpy as np
from pymilvus import (
MilvusClient, DataType
)

dim = 3
collection_name = "hello_milvus"
milvus_client = MilvusClient("http://localhost:19530/")

milvus_client.drop_collection(collection_name)

schema = milvus_client.create_schema(
auto_id=True,
)

schema.add_field(field_name="id", datatype=DataType.INT64, is_primary=True)
schema.add_field(field_name="vector", datatype=DataType.FLOAT_VECTOR, dim=dim)

index_params = milvus_client.prepare_index_params()
index_params.add_index(field_name = "vector", index_type="IVF_FLAT", metric_type="L2", nlist=10)

milvus_client.create_collection(
collection_name=collection_name,
schema=schema,
index_params=index_params
)
milvus_client.load_collection(collection_name=collection_name)
milvus_client.insert(collection_name=collection_name, data={"vector":[1,2,3]})
milvus_client.insert(collection_name=collection_name, data={"vector":[2,3,4]})
milvus_client.insert(collection_name=collection_name, data={"vector":[3,4,5]})

res = milvus_client.query(collection_name=collection_name, consistency_level="Strong", filter="id > 0")
for r in res:
print(r)
milvus_client.upsert(collection_name=collection_name, data={"id": r["id"], "vector": [0.1, 0.1, 0.1]})

res = milvus_client.query(collection_name=collection_name, consistency_level="Strong", filter="id > 0")
for r in res:
print(r)

@yanliang567
Copy link
Contributor

working on test verifivcation and development

@yanliang567
Copy link
Contributor

verified on master-20241012-d45e2677-amd64

sre-ci-robot pushed a commit that referenced this issue Oct 14, 2024
related issue: #36710

---------

Signed-off-by: yanliang567 <[email protected]>
sre-ci-robot pushed a commit that referenced this issue Oct 16, 2024
related issue: #36710
pr: #36820

---------

Signed-off-by: yanliang567 <[email protected]>
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