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

Sqlalchemy 2 cannot be used in projects using langchain. #1272

Closed
tback opened this issue Feb 24, 2023 · 6 comments · Fixed by #1726
Closed

Sqlalchemy 2 cannot be used in projects using langchain. #1272

tback opened this issue Feb 24, 2023 · 6 comments · Fixed by #1726

Comments

@tback
Copy link

tback commented Feb 24, 2023

Langchain depends on sqlalchemy<2. This prevents usage of the current version of sqlalchemy, even if neither the caching nor sqlchains features of langchain are being used.

Looking at this purely as a user it'd be ideal if langchain would be compatible with both sqlalchemy 1.4.x and 2.x.x. Implementing this might be a lot of work though. I think few users would be impacted if sqlalchemy would be converted into an optional dependency of langchain, which would also resolve this issue for me.

@tonyf
Copy link

tonyf commented Feb 27, 2023

+1 this. It would be great if sqlalchemy was an optional dependency since (1) we dont use it's features in langchain and (2) it conflicts with our existing codebase which depends on sqlalchemy>=2.0

@jzluo
Copy link
Contributor

jzluo commented Feb 28, 2023

It seems like the only blocker for allowing both SQLAlchemy 1.4 and 2.0 is the dependency on duckdb-engine, which is used for Chroma. duckdb-engine is not compatible with SQLAlchemy 2.0. It looks like this may be updated soon on their end Mause/duckdb_engine#439

@Mause
Copy link

Mause commented Mar 8, 2023

I've since released version 0.7.0-rc1 with tentative compatibility with SQLAlchemy 2, once I've heard back from a couple of projects and they've had to chance to test it, I'll release 0.7.0

@hwchase17
Copy link
Contributor

thanks @Mause and @alexmavr!

hwchase17 pushed a commit that referenced this issue Mar 17, 2023
@sliedes
Copy link
Contributor

sliedes commented Mar 17, 2023

I think the sqlalchemy dependency in pyproject.toml still needs to be bumped.

@kenn
Copy link

kenn commented Mar 18, 2023

v0.0.27 used to have the wildcard for sqlalchemy. Maybe bring it back?

sqlalchemy = "*"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants