From d068e8ea54061b36af5f59b644e0370990048f7c Mon Sep 17 00:00:00 2001 From: David Loving <107890550+Davidkloving@users.noreply.github.com> Date: Thu, 22 Feb 2024 12:17:07 -0600 Subject: [PATCH] community[patch]: compatibility with SQLAlchemy 1.4.x (#17954) **Description:** Change type hint on `QuerySQLDataBaseTool` to be compatible with SQLAlchemy v1.4.x. **Issue:** Users locked to `SQLAlchemy < 2.x` are unable to import `QuerySQLDataBaseTool`. closes https://github.com/langchain-ai/langchain/issues/17819 **Dependencies:** None --- libs/community/langchain_community/tools/sql_database/tool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/community/langchain_community/tools/sql_database/tool.py b/libs/community/langchain_community/tools/sql_database/tool.py index e68923bdcf..9d4f90b724 100644 --- a/libs/community/langchain_community/tools/sql_database/tool.py +++ b/libs/community/langchain_community/tools/sql_database/tool.py @@ -44,7 +44,7 @@ class QuerySQLDataBaseTool(BaseSQLDatabaseTool, BaseTool): self, query: str, run_manager: Optional[CallbackManagerForToolRun] = None, - ) -> Union[str, Sequence[Dict[str, Any]], Result[Any]]: + ) -> Union[str, Sequence[Dict[str, Any]], Result]: """Execute the query, return the results or an error message.""" return self.db.run_no_throw(query)