Strings converted into datetime object

Upon executing an upsert operation on the vector provided below, I noticed that the document_id was automatically converted into a datetime.date object.

Here is the vector:
vector = {
“text”: “Some random text”,
“metadata”: {
“name”: “text_1”,
“document_id”: “16790821”,
“ref_id”: “ref_1”,
“id”: “21256”
}
}
After querying the vector, this is what was returned:
{
‘matches’: [{
‘id’: ‘21256’,
‘metadata’: {
‘document_id’: datetime.date(1679, 8, 21),
‘id’: ‘21256’,
‘name’: ‘text_1’,
‘ref_id’: ‘ref_1’,
‘text’: ‘Some random text’
},
‘score’: 1.0,
‘values’:
}],
‘namespace’: ‘’
}

Is this an unintended bug, or is it predictable behavior? I couldn’t find any relevant information about this within the official Pinecone documentation. Furthermore, is there a method to prevent numerical strings of a certain length from being converted into datetime.date objects?

2 Likes

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, If you use GRPCIndex, it will be fine there. More information can be found on Github this issue.

1 Like

Indeed, GRPCIndex works as expected. However, I encountered an issue while using the pinecone.GRPCIndex with the base pip3 installation of pinecone. To resolve this, I had install a couple of additional libraries and downgrade a particular one. I would strongly recommend that this anomaly be documented officially as it is a non-trivial issue and has the potential to create problems for users who might not be aware of this.

2 Likes

I’ve been dealing with this for the last hour until I discovered that the issue was with Pinecone. I’m surprised that this bug hasn’t been fixed yet, as @mnmx mentioned it is a non-trivial issue.

When can we expect it to be fixed? When using Langchain with Pinecone, it is not possible to use the GRPCIndex instance, so this workaround is not fixing the issue.

1 Like

@maciej.morzywolek Apologies for the confusion caused by this issue.

We have a pull request in waiting that implements the fix, which will go out with our next SDK release. You can follow our release notes for updates. Thanks!

1 Like

UPDATE: Bug has been fixed with the latest v3.0.0 release: Release Release v3.0.0 · pinecone-io/pinecone-python-client · GitHub

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.