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

Issue with payload type when creating a new point #14

Closed
transiteration opened this issue Dec 29, 2021 · 4 comments
Closed

Issue with payload type when creating a new point #14

transiteration opened this issue Dec 29, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@transiteration
Copy link

Hello everyone! I have a problem creating a new point. When I set the payload for a new vector, they all turn into a string. Because of this, I cannot further filter vectors with Range().

client.http.points_api.update_points( name=COLLECTION_NAME, wait=True, collection_update_operations=PointOperationsAnyOf( upsert_points=PointInsertOperationsAnyOf1( points=[ PointStruct( id=123, payload={'value': random.random()}, vector=np.random.rand(DIM).tolist() ) ] ) ) )

Output:
(ScoredPoint(id=123, payload=None, score=24.59514, version=0), {'value': ['0.0510552054339094']})

'value': ['0.0510552054339094']
I tried to do update the payload but in the end, it was string type.

@generall
Copy link
Member

Hi @mirasakibara, thanks for reporting this! I could reproduce it and it is definitely a bug. It looks like the problem is not related to Qdrant itself but rather to the python client. So I am going to transfer this issue to the https://github.com/qdrant/qdrant_client.

In the meanwhile you can use the following workaround:

{'value': random.random()}

replace with

{'value': {"type": "float", "value":  random.random()}}

@generall generall transferred this issue from qdrant/qdrant Dec 29, 2021
@generall generall added the bug Something isn't working label Dec 29, 2021
@generall
Copy link
Member

Looks like the problem is related to https://pydantic-docs.helpmanual.io/usage/model_config/#smart-union

@transiteration
Copy link
Author

Thank you for your help!!!

@generall
Copy link
Member

Also related to pydantic/pydantic#1098

(Reopen issue, cause it should be fixed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants