From 15bd1154a754da834756a705915b542dc81b3059 Mon Sep 17 00:00:00 2001 From: Erick Friis Date: Tue, 6 Feb 2024 11:56:00 -0800 Subject: [PATCH] pinecone[patch]: integration test new namespace (#17121) --- .../pinecone/tests/integration_tests/test_vectorstores.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/partners/pinecone/tests/integration_tests/test_vectorstores.py b/libs/partners/pinecone/tests/integration_tests/test_vectorstores.py index 3abdabe256..eb1f959839 100644 --- a/libs/partners/pinecone/tests/integration_tests/test_vectorstores.py +++ b/libs/partners/pinecone/tests/integration_tests/test_vectorstores.py @@ -100,15 +100,17 @@ class TestPinecone: texts = [needs] + texts metadatas = [{"page": i} for i in range(len(texts))] + + namespace = f"{NAMESPACE_NAME}-md" docsearch = Pinecone.from_texts( texts, embedding_openai, index_name=INDEX_NAME, metadatas=metadatas, - namespace=NAMESPACE_NAME, + namespace=namespace, ) time.sleep(DEFAULT_SLEEP) # prevent race condition - output = docsearch.similarity_search(needs, k=1, namespace=NAMESPACE_NAME) + output = docsearch.similarity_search(needs, k=1, namespace=namespace) # TODO: why metadata={"page": 0.0}) instead of {"page": 0}? assert output == [Document(page_content=needs, metadata={"page": 0.0})]