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

Bug: Fix issue with Pinecone custom namespaces not being created automatically #38336

Merged
merged 3 commits into from
May 18, 2024

Conversation

bindipankhudi
Copy link
Contributor

@bindipankhudi bindipankhudi requested a review from a team as a code owner May 17, 2024 23:47
Copy link

vercel bot commented May 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 18, 2024 0:14am

@@ -137,7 +137,9 @@ def index(self, document_chunks, namespace, streamName):
for batch in serial_batches:
async_results = []
for ids_vectors_chunk in create_chunks(batch, batch_size=PINECONE_BATCH_SIZE):
async_result = self.pinecone_index.upsert(vectors=ids_vectors_chunk, async_req=True, show_progress=False)
async_result = self.pinecone_index.upsert(
vectors=ids_vectors_chunk, async_req=True, show_progress=False, namespace=namespace
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added back namespace param which got removed during pinecone serverless implementation.

@@ -107,3 +125,44 @@ def test_write(self):
vector_store = Pinecone(self.pinecone_index_rest, embeddings.embed_query, "text")
result = vector_store.similarity_search("feline animals", 1)
assert result[0].metadata["_ab_record_id"] == "mystream_2"

def test_write_with_namespace(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added tests which insert with namespace

Copy link
Collaborator

@aaronsteers aaronsteers left a comment

Choose a reason for hiding this comment

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

Looks good!!

@bindipankhudi bindipankhudi merged commit b7de9f1 into master May 18, 2024
34 checks passed
@bindipankhudi bindipankhudi deleted the bindi/pinecone-namespace-bug branch May 18, 2024 00:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/connectors Connector related issues area/documentation Improvements or additions to documentation connectors/destination/pinecone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants