langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Import of `declarative_base` when SQLAlchemy <1.4

Open s16h opened this issue 1 year ago • 3 comments

In pyproject.toml, the expectation is SQLAlchemy = "^1". But, the way declarative_base is imported in cache.py will only work with SQLAlchemy >=1.4. This PR makes sure Langchain can be run in environments with SQLAlchemy <1.4

s16h avatar Feb 04 '23 15:02 s16h

In general, it feels like SQLAlchemy should be made to be an optional dependency. What do you think, @hwchase17?

s16h avatar Feb 04 '23 16:02 s16h

In general, it feels like SQLAlchemy should be made to be an optional dependency. What do you think, @hwchase17?

yeah let me take a look into that

im also fine just bumping the requirements to be "^1.4" - thoughts on that?

hwchase17 avatar Feb 04 '23 17:02 hwchase17

im also fine just bumping the requirements to be "^1.4" - thoughts on that?

The move from 1.3 to 1.4 isn't trivial (i.e., it's not just a matter of upgrading, as I learnt earlier today). So, that'd possibly make life difficult for LangChain users — that's certainly the case for us. Given how popular <1.4 is in the wild, I think it'd make sense to support it. Just my two cents.

s16h avatar Feb 04 '23 19:02 s16h

I know you're busy with exciting stuff @hwchase17 (💪), but, thoughts on this? 😊

s16h avatar Feb 10 '23 23:02 s16h

I know you're busy with exciting stuff @hwchase17 (💪), but, thoughts on this? 😊

sorry for delay - agree this should be fixed. will get into the next release

hwchase17 avatar Feb 11 '23 02:02 hwchase17