fix(sql_database): related to #2020 (#2021)

Fixed https://github.com/hwchase17/langchain/issues/2020

Co-authored-by: qianjun.wqj <qianjun.wqj@alibaba-inc.com>
This commit is contained in:
Clark 2023-03-28 14:45:50 +08:00 committed by GitHub
parent d5825bd3e8
commit e0331b55bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,7 +124,7 @@ class SQLDatabase:
if self._sample_rows_in_table_info: if self._sample_rows_in_table_info:
# build the select command # build the select command
command = select(table).limit(self._sample_rows_in_table_info) command = select([table]).limit(self._sample_rows_in_table_info)
# save the columns in string format # save the columns in string format
columns_str = "\t".join([col.name for col in table.columns]) columns_str = "\t".join([col.name for col in table.columns])