From 8d4547ae976ef33eacac8967d510f24abfd8e471 Mon Sep 17 00:00:00 2001 From: Mohammad Mohtashim <45242107+keenborder786@users.noreply.github.com> Date: Sat, 17 Feb 2024 02:59:08 +0500 Subject: [PATCH] [Langchain_community]: Corrected the imports to make them compatible with Sqlachemy <2.0 (#17653) - Small Change in Imports in sql_database module to make it work with Sqlachemy <2.0 - This was identified in the following issue: #17616 --- libs/community/langchain_community/utilities/sql_database.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/community/langchain_community/utilities/sql_database.py b/libs/community/langchain_community/utilities/sql_database.py index 087ac44bc112f..fb542cfa88392 100644 --- a/libs/community/langchain_community/utilities/sql_database.py +++ b/libs/community/langchain_community/utilities/sql_database.py @@ -7,18 +7,17 @@ from langchain_core._api import deprecated from langchain_core.utils import get_from_env from sqlalchemy import ( - Executable, MetaData, - Result, Table, create_engine, inspect, select, text, ) -from sqlalchemy.engine import Engine +from sqlalchemy.engine import Engine, Result from sqlalchemy.exc import ProgrammingError, SQLAlchemyError from sqlalchemy.schema import CreateTable +from sqlalchemy.sql.expression import Executable from sqlalchemy.types import NullType