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

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

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

jhamon
Copy link
Collaborator

@jhamon jhamon commented Jul 24, 2024

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

  • Bug fix (non-breaking change which fixes an issue)

@jhamon jhamon changed the title [Fix] Fetch/query when vector id string contains spaces [Fix] Fetch when vector id string contains spaces Jul 24, 2024
@jhamon jhamon marked this pull request as ready for review July 24, 2024 17:51
@jhamon jhamon requested review from aulorbe and austin-denoble July 24, 2024 17:51
"%x",
"{0}",
]
ids.extend(unwanted_interpolation)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

total nit, but it just be simpler to do something like return booleanish + script_injection + unwanted_interpolation, instead of calling ids.extend mult times?

@jhamon jhamon merged commit 0f57dca into main Jul 30, 2024
85 checks passed
@jhamon jhamon deleted the jhamon/ids-with-spaces branch July 30, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants