pgvector.py has created a dependency on sqlalchemy v2, breaking apps using sqlalchemy v1 #19681
Open
5 tasks done
Labels
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
🔌: postgres
Related to postgres integrations
Ɑ: retriever
Related to retriever module
Checked other resources
Example Code
from langchain.retrievers.multi_query import MultiQueryRetriever
Error Message and Stack Trace (if applicable)
Traceback (most recent call last):
File "", line 1, in
File "/home/ubuntu/miniconda3/envs/nettalk/lib/python3.12/site-packages/langchain/retrievers/init.py", line 33, in
from langchain.retrievers.self_query.base import SelfQueryRetriever
File "/home/ubuntu/miniconda3/envs/nettalk/lib/python3.12/site-packages/langchain/retrievers/self_query/base.py", line 5, in
from langchain_community.vectorstores import (
File "/home/ubuntu/miniconda3/envs/nettalk/lib/python3.12/site-packages/langchain_community/vectorstores/init.py", line 115, in getattr
module = importlib.import_module(_module_lookup[name])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/miniconda3/envs/nettalk/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ubuntu/miniconda3/envs/nettalk/lib/python3.12/site-packages/langchain_community/vectorstores/pgvector.py", line 23, in
from sqlalchemy import SQLColumnExpression, delete, func
ImportError: cannot import name 'SQLColumnExpression' from 'sqlalchemy' (/home/ubuntu/miniconda3/envs/nettalk/lib/python3.12/site-packages/sqlalchemy/init.py)
Description
My app uses sqlalchemy v1 due to my db dialect not supporting v2. The above change breaks MultiQueryRetriever in 0.1.13.
System Info
System Information
Package Information
Packages not installed (Not Necessarily a Problem)
The following packages were not found:
The text was updated successfully, but these errors were encountered: