dwreeves commented on code in PR #31846:
URL: https://github.com/apache/airflow/pull/31846#discussion_r1227148457
##########
airflow/providers/databricks/hooks/databricks_sql.py:
##########
@@ -138,15 +141,39 @@ def get_conn(self) -> Connection:
)
return self._sql_conn
+ @overload
+ def run(
+ self,
+ sql: str | Iterable[str],
+ autocommit: bool = False,
+ parameters: Iterable | Mapping | None = None,
+ handler: None = None,
+ split_statements: bool = True,
+ return_last: bool = True,
+ ) -> None:
+ ...
+
+ @overload
+ def run(
+ self,
+ sql: str | Iterable[str],
+ autocommit: bool = False,
+ parameters: Iterable | Mapping | None = None,
Review Comment:
Looking at the SQLAlchemy source code, we can also probably update
`Iterable` to `Iterable[Mapping[str, Any]]`.
https://github.com/sqlalchemy/sqlalchemy/blob/f20f45fae24a4818dc8be5d31a46695b9d16c897/lib/sqlalchemy/engine/interfaces.py#L226-L231C1
See here for the type annotation used by the PEP 249 cursor's execute method:
https://docs.sqlalchemy.org/en/20/core/connections.html#sqlalchemy.engine.Connection.execute
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]