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(langchain): use correct class names for pinecone vectorstore check #9759

Merged
merged 22 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
663970c
Use correct class names for pinecone vectorstores
Yun-Kim Jul 8, 2024
564a023
Add regression test, change riotfile to remove langchain-pinecone dep…
Yun-Kim Jul 8, 2024
5a9b9e0
Fix base langchain check as well
Yun-Kim Jul 9, 2024
76c56f1
Merge branch 'main' into yunkim/langchain-pinecone-vectorstore-fix
Yun-Kim Jul 11, 2024
c57354e
add conditional skip for langchain-community
Yun-Kim Jul 11, 2024
f7527b6
keep langchain-pinecone dependency for easier testing
Yun-Kim Jul 11, 2024
ace857f
Fix test
Yun-Kim Jul 11, 2024
a6db71d
Add faiss-cpu as dependency
Yun-Kim Jul 11, 2024
280105c
Move faiss dependency to langchain community test venvs only, skip ot…
Yun-Kim Jul 13, 2024
0c4acea
ignore pinecone test span tag due to updated dependencies
Yun-Kim Jul 13, 2024
0198e41
Merge branch 'main' into yunkim/langchain-pinecone-vectorstore-fix
emmettbutler Jul 15, 2024
aa740b0
ignore snapshot test assertion due to updated dependencies
Yun-Kim Jul 15, 2024
b13ee23
Merge branch 'main' into yunkim/langchain-pinecone-vectorstore-fix
Yun-Kim Jul 15, 2024
e814681
Merge branch 'main' into yunkim/langchain-pinecone-vectorstore-fix
Yun-Kim Jul 16, 2024
7647611
Merge branch 'main' into yunkim/langchain-pinecone-vectorstore-fix
Yun-Kim Jul 16, 2024
121973c
Merge branch 'main' into yunkim/langchain-pinecone-vectorstore-fix
Yun-Kim Jul 16, 2024
4c2d229
Merge branch 'main' into yunkim/langchain-pinecone-vectorstore-fix
Yun-Kim Jul 17, 2024
2df9768
Merge branch 'main' into yunkim/langchain-pinecone-vectorstore-fix
Yun-Kim Jul 17, 2024
02c34b2
Merge branch 'main' into yunkim/langchain-pinecone-vectorstore-fix
Yun-Kim Jul 17, 2024
c2e1b76
Mark llmobs tests as flaky due to langchain community vcr
Yun-Kim Jul 18, 2024
28193e5
Merge branch 'main' into yunkim/langchain-pinecone-vectorstore-fix
Yun-Kim Jul 18, 2024
20653e4
Merge branch 'main' into yunkim/langchain-pinecone-vectorstore-fix
Yun-Kim Jul 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions .riot/requirements/787b021.txt → .riot/requirements/28800d1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
# This file is autogenerated by pip-compile with Python 3.9
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/787b021.in
# pip-compile --no-annotate .riot/requirements/28800d1.in
#
ai21==2.6.0
ai21-tokenizer==0.9.1
ai21==2.9.0
ai21-tokenizer==0.11.2
aiohttp==3.9.5
aiosignal==1.3.1
annotated-types==0.7.0
anthropic==0.28.1
anthropic==0.30.1
anyio==4.4.0
async-timeout==4.0.3
attrs==23.2.0
boto3==1.34.126
botocore==1.34.126
certifi==2024.6.2
boto3==1.34.141
botocore==1.34.141
certifi==2024.7.4
charset-normalizer==3.3.2
cohere==5.4.0
coverage[toml]==7.5.3
coverage[toml]==7.5.4
dataclasses-json==0.6.7
defusedxml==0.7.1
distro==1.9.0
exceptiongroup==1.2.1
fastavro==1.9.4
filelock==3.15.1
fastavro==1.9.5
filelock==3.15.4
frozenlist==1.4.1
fsspec==2024.6.0
fsspec==2024.6.1
greenlet==3.0.3
h11==0.14.0
httpcore==1.0.5
Expand All @@ -35,9 +35,9 @@ httpx-sse==0.4.0
huggingface-hub==0.23.4
hypothesis==6.45.0
idna==3.7
importlib-metadata==7.1.0
importlib-metadata==8.0.0
iniconfig==2.0.0
jiter==0.4.2
jiter==0.5.0
jmespath==1.0.1
jsonpatch==1.33
jsonpointer==3.0.0
Expand All @@ -48,24 +48,24 @@ langchain-cohere==0.1.4
langchain-community==0.0.38
langchain-core==0.1.52
langchain-openai==0.1.6
langchain-pinecone==0.1.0
langchain-text-splitters==0.0.2
langsmith==0.1.77
langsmith==0.1.84
marshmallow==3.21.3
mock==5.1.0
multidict==6.0.5
mypy-extensions==1.0.0
numexpr==2.10.0
numexpr==2.10.1
numpy==1.26.4
openai==1.30.3
opentracing==2.4.0
orjson==3.10.5
orjson==3.10.6
packaging==23.2
pinecone-client==3.2.2
pinecone-client==4.1.2
pinecone-plugin-interface==0.0.7
pluggy==1.5.0
psutil==5.9.8
pydantic==2.7.4
pydantic-core==2.18.4
psutil==6.0.0
pydantic==2.8.2
pydantic-core==2.20.1
pytest==8.2.2
pytest-asyncio==0.21.1
pytest-cov==5.0.0
Expand All @@ -75,13 +75,13 @@ python-dateutil==2.9.0.post0
pyyaml==6.0.1
regex==2024.5.15
requests==2.32.3
s3transfer==0.10.1
s3transfer==0.10.2
sentencepiece==0.2.0
six==1.16.0
sniffio==1.3.1
sortedcontainers==2.4.0
sqlalchemy==2.0.30
tenacity==8.3.0
sqlalchemy==2.0.31
tenacity==8.5.0
tiktoken==0.7.0
tokenizers==0.19.1
tomli==2.0.1
Expand All @@ -90,7 +90,7 @@ types-requests==2.31.0.6
types-urllib3==1.26.25.14
typing-extensions==4.12.2
typing-inspect==0.9.0
urllib3==1.26.18
urllib3==1.26.19
vcrpy==6.0.1
wrapt==1.16.0
yarl==1.9.4
Expand Down
50 changes: 25 additions & 25 deletions .riot/requirements/1c14c70.txt → .riot/requirements/87fd5a1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/1c14c70.in
# pip-compile --no-annotate .riot/requirements/87fd5a1.in
#
ai21==2.6.0
ai21-tokenizer==0.9.1
ai21==2.9.0
ai21-tokenizer==0.11.2
aiohttp==3.9.5
aiosignal==1.3.1
annotated-types==0.7.0
anthropic==0.28.1
anthropic==0.30.1
anyio==4.4.0
attrs==23.2.0
boto3==1.34.126
botocore==1.34.126
certifi==2024.6.2
boto3==1.34.141
botocore==1.34.141
certifi==2024.7.4
charset-normalizer==3.3.2
cohere==5.4.0
coverage[toml]==7.5.3
coverage[toml]==7.5.4
dataclasses-json==0.6.7
defusedxml==0.7.1
distro==1.9.0
exceptiongroup==1.2.1
fastavro==1.9.4
filelock==3.15.1
fastavro==1.9.5
filelock==3.15.4
frozenlist==1.4.1
fsspec==2024.6.0
fsspec==2024.6.1
greenlet==3.0.3
h11==0.14.0
httpcore==1.0.5
Expand All @@ -35,7 +35,7 @@ huggingface-hub==0.23.4
hypothesis==6.45.0
idna==3.7
iniconfig==2.0.0
jiter==0.4.2
jiter==0.5.0
jmespath==1.0.1
jsonpatch==1.33
jsonpointer==3.0.0
Expand All @@ -46,24 +46,24 @@ langchain-cohere==0.1.4
langchain-community==0.0.38
langchain-core==0.1.52
langchain-openai==0.1.6
langchain-pinecone==0.1.0
langchain-text-splitters==0.0.2
langsmith==0.1.77
langsmith==0.1.84
marshmallow==3.21.3
mock==5.1.0
multidict==6.0.5
mypy-extensions==1.0.0
numexpr==2.10.0
numexpr==2.10.1
numpy==1.26.4
openai==1.30.3
opentracing==2.4.0
orjson==3.10.5
orjson==3.10.6
packaging==23.2
pinecone-client==3.2.2
pinecone-client==4.1.2
pinecone-plugin-interface==0.0.7
pluggy==1.5.0
psutil==5.9.8
pydantic==2.7.4
pydantic-core==2.18.4
psutil==6.0.0
pydantic==2.8.2
pydantic-core==2.20.1
pytest==8.2.2
pytest-asyncio==0.21.1
pytest-cov==5.0.0
Expand All @@ -73,20 +73,20 @@ python-dateutil==2.9.0.post0
pyyaml==6.0.1
regex==2024.5.15
requests==2.32.3
s3transfer==0.10.1
s3transfer==0.10.2
sentencepiece==0.2.0
six==1.16.0
sniffio==1.3.1
sortedcontainers==2.4.0
sqlalchemy==2.0.30
tenacity==8.3.0
sqlalchemy==2.0.31
tenacity==8.5.0
tiktoken==0.7.0
tokenizers==0.19.1
tqdm==4.66.4
types-requests==2.32.0.20240602
types-requests==2.32.0.20240622
typing-extensions==4.12.2
typing-inspect==0.9.0
urllib3==2.2.1
urllib3==2.2.2
vcrpy==6.0.1
wrapt==1.16.0
yarl==1.9.4
50 changes: 25 additions & 25 deletions .riot/requirements/14f5b1d.txt → .riot/requirements/a81937d.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --no-annotate .riot/requirements/14f5b1d.in
# pip-compile --no-annotate .riot/requirements/a81937d.in
#
ai21==2.6.0
ai21-tokenizer==0.9.1
ai21==2.9.0
ai21-tokenizer==0.11.2
aiohttp==3.9.5
aiosignal==1.3.1
annotated-types==0.7.0
anthropic==0.28.1
anthropic==0.30.1
anyio==4.4.0
async-timeout==4.0.3
attrs==23.2.0
boto3==1.34.126
botocore==1.34.126
certifi==2024.6.2
boto3==1.34.141
botocore==1.34.141
certifi==2024.7.4
charset-normalizer==3.3.2
cohere==5.4.0
coverage[toml]==7.5.3
coverage[toml]==7.5.4
dataclasses-json==0.6.7
defusedxml==0.7.1
distro==1.9.0
exceptiongroup==1.2.1
fastavro==1.9.4
filelock==3.15.1
fastavro==1.9.5
filelock==3.15.4
frozenlist==1.4.1
fsspec==2024.6.0
fsspec==2024.6.1
greenlet==3.0.3
h11==0.14.0
httpcore==1.0.5
Expand All @@ -36,7 +36,7 @@ huggingface-hub==0.23.4
hypothesis==6.45.0
idna==3.7
iniconfig==2.0.0
jiter==0.4.2
jiter==0.5.0
jmespath==1.0.1
jsonpatch==1.33
jsonpointer==3.0.0
Expand All @@ -47,24 +47,24 @@ langchain-cohere==0.1.4
langchain-community==0.0.38
langchain-core==0.1.52
langchain-openai==0.1.6
langchain-pinecone==0.1.0
langchain-text-splitters==0.0.2
langsmith==0.1.77
langsmith==0.1.84
marshmallow==3.21.3
mock==5.1.0
multidict==6.0.5
mypy-extensions==1.0.0
numexpr==2.10.0
numexpr==2.10.1
numpy==1.26.4
openai==1.30.3
opentracing==2.4.0
orjson==3.10.5
orjson==3.10.6
packaging==23.2
pinecone-client==3.2.2
pinecone-client==4.1.2
pinecone-plugin-interface==0.0.7
pluggy==1.5.0
psutil==5.9.8
pydantic==2.7.4
pydantic-core==2.18.4
psutil==6.0.0
pydantic==2.8.2
pydantic-core==2.20.1
pytest==8.2.2
pytest-asyncio==0.21.1
pytest-cov==5.0.0
Expand All @@ -74,21 +74,21 @@ python-dateutil==2.9.0.post0
pyyaml==6.0.1
regex==2024.5.15
requests==2.32.3
s3transfer==0.10.1
s3transfer==0.10.2
sentencepiece==0.2.0
six==1.16.0
sniffio==1.3.1
sortedcontainers==2.4.0
sqlalchemy==2.0.30
tenacity==8.3.0
sqlalchemy==2.0.31
tenacity==8.5.0
tiktoken==0.7.0
tokenizers==0.19.1
tomli==2.0.1
tqdm==4.66.4
types-requests==2.32.0.20240602
types-requests==2.32.0.20240622
typing-extensions==4.12.2
typing-inspect==0.9.0
urllib3==2.2.1
urllib3==2.2.2
vcrpy==6.0.1
wrapt==1.16.0
yarl==1.9.4
4 changes: 2 additions & 2 deletions ddtrace/contrib/langchain/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ def _is_pinecone_vectorstore_instance(instance):
"""
try:
if not PATCH_LANGCHAIN_V0 and langchain_pinecone:
return isinstance(instance, langchain_pinecone.VectorStore)
return isinstance(instance, langchain_pinecone.PineconeVectorStore)
if not PATCH_LANGCHAIN_V0 and langchain_community:
return isinstance(instance, langchain_community.vectorstores.VectorStore)
return isinstance(instance, langchain_community.vectorstores.Pinecone)
return isinstance(instance, langchain.vectorstores.VectorStore)
except (AttributeError, ModuleNotFoundError, ImportError):
return False
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
fixes:
- |
langchain: This fix resolves an issue where the wrong langchain class name was being used to check for Pinecone vectorstore instances.
1 change: 0 additions & 1 deletion riotfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2500,7 +2500,6 @@ def select_pys(min_version=MIN_PYTHON_VERSION, max_version=MAX_PYTHON_VERSION):
"langchain-core": "==0.1.52",
"langchain-openai": "==0.1.6",
"langchain-anthropic": "==0.1.11",
"langchain-pinecone": "==0.1.0",
"langchain-aws": "==0.1.3",
"langchain-cohere": "==0.1.4",
"openai": "==1.30.3",
Expand Down
Loading
Loading