pinecone-io / pinecone-python-client

The Pinecone Python client
https://www.pinecone.io/docs
Apache License 2.0
309 stars 80 forks source link

[Fix] Fetch when vector id string contains spaces #372

Closed jhamon closed 3 months ago

jhamon commented 4 months ago

Problem

Some data operations fail when the vector id string contains a space.

from pinecone import Pinecone

pc = Pinecone()
pc.fetch(ids=["id with string"]) # no results returned, even when vector exists

Solution

The problem occurred due to the way spaces were being encoded as + instead of %20 in url query params. The fix was a small adjustment to our code generation templates.

I added test coverage for upsert / query / fetch with various weird ids to make sure the change in encoding hasn't broken any other use cases that could pop up.

Type of Change