Sqlalchemy 2 cannot be used in projects using langchain.
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.
+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
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 https://github.com/Mause/duckdb_engine/pull/439
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
thanks @Mause and @alexmavr!
I think the sqlalchemy dependency in pyproject.toml still needs to be bumped.
v0.0.27 used to have the wildcard for sqlalchemy. Maybe bring it back?
sqlalchemy = "*"