Skip to content

Commit 621ab11

Browse files
jzluovowelparrot
authored andcommitted
Support SQLAlchemy 2.0 (#3310)
With executablebooks/jupyter-cache#93 merged and `MyST-NB` updated, we can now support SQLAlchemy 2. Closes #1766
1 parent 4bb95ad commit 621ab11

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

langchain/sql_database.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def _get_table_indexes(self, table: Table) -> str:
180180

181181
def _get_sample_rows(self, table: Table) -> str:
182182
# build the select command
183-
command = select([table]).limit(self._sample_rows_in_table_info)
183+
command = select(table).limit(self._sample_rows_in_table_info)
184184

185185
# save the columns in string format
186186
columns_str = "\t".join([col.name for col in table.columns])

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ langchain-server = "langchain.server:main"
1313
[tool.poetry.dependencies]
1414
python = ">=3.8.1,<4.0"
1515
pydantic = "^1"
16-
SQLAlchemy = "^1"
16+
SQLAlchemy = ">1.3,<3"
1717
requests = "^2"
1818
PyYAML = ">=5.4.1"
1919
numpy = "^1"

0 commit comments

Comments
 (0)