You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Metadata string value returned as datetime.date #161
I believe this is a new bug in the Pinecone Python Client
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
If you upload a metadata field with a certain format, for example the string "1002.6.3" , pinecone will return the datetime object: datetime.date(1002,6,2) instead of the string "1002.6.3"
I'm not certain of all of the formats that lead to his behavior
Expected Behavior
The returned metadata value should be the string"1002.6.3"
Steps To Reproduce
upload a vector with metadata: {"exampleField": "1002.6.3"}
query the database for that vector. You'll see a datetime.date object instead of a string
@mneira10 this is a known bug at the moment. This is because the openapi generated code we use for our REST client does this conversion as the spec does not clearly define all accepted openapi types. While we fix this, I suggest using GRPCIndex; it will be fine there.
As a possible workaround for others facing the same issue. You can adjust the formatting by adding a prefix or similar so that it won't be picked up as a date
Thanks for the suggestion :)
I think it might be better to make these changes at the proto/spec level and avoid other data type-related issues. Our v3 client is in dev release atm (stable release should be out soon), but it is gRPC only and hence avoids some issues like these, which are downstream of our json-grpc transcoding decisions.
Hi @rajat08 ! Is this solved in the the v3.0.x versions?
Our v3 client is in dev release atm (stable release should be out soon), but it is gRPC only and hence avoids some issues like these, which are downstream of our json-grpc transcoding decisions.
I see that the upgrade guide has a dedicated section to on how to use a gRPC index which suggests that v3.x doesn't use gRPC by default with:
# does this use gRPC? If not, does it now handle strings well?pc=Pinecone(api_key=...)
index=pc.Index(PINECONE_INDEX_NAME)
Activity
rajat08 commentedon Apr 5, 2023
@mneira10 this is a known bug at the moment. This is because the openapi generated code we use for our REST client does this conversion as the spec does not clearly define all accepted openapi types. While we fix this, I suggest using GRPCIndex; it will be fine there.
mneira10 commentedon Apr 5, 2023
Thanks for the swift response!
Good to know! Thanks
As a possible workaround for others facing the same issue. You can adjust the formatting by adding a prefix or similar so that it won't be picked up as a date
rajat08 commentedon Apr 5, 2023
Thanks for the suggestion :)
I think it might be better to make these changes at the proto/spec level and avoid other data type-related issues. Our v3 client is in dev release atm (stable release should be out soon), but it is gRPC only and hence avoids some issues like these, which are downstream of our json-grpc transcoding decisions.
masonchambersiii commentedon Jul 12, 2023
Was this ever resolved? Im still running into this issue?
rajat08 commentedon Jul 12, 2023
Not yet for REST. Can you use GRPCIndex?
masonchambersiii commentedon Jul 12, 2023
Ended up just using the GRPC and it works fine -- but pretty surprised this issue hasnt been resolved for rest!
mneira10 commentedon Jan 30, 2024
Hi @rajat08 ! Is this solved in the the v3.0.x versions?
I see that the upgrade guide has a dedicated section to on how to use a gRPC index which suggests that v3.x doesn't use gRPC by default with:
Should we use this instead?
zeke-emerson commentedon Feb 6, 2024
@mneira10 This issue is fixed in v3.0.x of the Python client! To be clear, the fix allows the non-GRPC client to handle date strings as expected.
mneira10 commentedon Feb 6, 2024
That's awesome! Thanks for clarifying that! 🚀
feat(grpc): total_timeout on GrpcIndex.upsert — the knob the docstrin…