Skip to content

Commit

Permalink
community[patch]: pinecone bug (#15905)
Browse files Browse the repository at this point in the history
  • Loading branch information
efriis authored Jan 11, 2024
1 parent 44101b6 commit 623f87c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions libs/community/langchain_community/vectorstores/pinecone.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ def _import_pinecone() -> Any:
def _is_pinecone_v3() -> bool:
pinecone = _import_pinecone()
pinecone_client_version = pinecone.__version__
if version.parse(pinecone_client_version) >= version.parse("3.0.0.dev"):
return True
else:
return False
return version.parse(pinecone_client_version) >= version.parse("3.0.0.dev")


class Pinecone(VectorStore):
Expand Down Expand Up @@ -380,7 +377,7 @@ def get_pinecone_index(
if index_name in index_names:
index = (
pinecone_instance.Index(index_name)
if not _is_pinecone_v3()
if _is_pinecone_v3()
else pinecone.Index(index_name, pool_threads=pool_threads)
)
elif len(index_names) == 0:
Expand Down

0 comments on commit 623f87c

Please sign in to comment.