-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -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 |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!!
Related to #38335
and https://github.com/airbytehq/oncall/issues/5319