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
pull/17978/head
David Loving 4 months ago committed by GitHub
parent e237dcec91
commit d068e8ea54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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)

Loading…
Cancel
Save