williesb commented on issue #23431:
URL: https://github.com/apache/airflow/issues/23431#issuecomment-1115516084
@uranusjr I think it would still be worth it for `TrinoHook.run()` to honor
the `DbApiHook.run()` arguments.
DbApiHook (sql -> str or list)
```
def run(self, sql, autocommit=False, parameters=None, handler=None):
"""
Runs a **command or a list of commands.** Pass a list of sql
statements to the sql parameter to get them to execute
sequentially
:param sql: the sql statement to be executed **(str) or a list of
sql statements** to execute
```
TrinoHook (sql -> only str)
```
def run(
self,
sql: str = "",
autocommit: bool = False,
parameters: Optional[dict] = None,
handler: Optional[Callable] = None,
hql: str = "",
) -> None:
```
The functionality to execute a many statements is already in `DbApiHook`.
You just need to call run with a list of statements instead of a single string
of semi-colon separated statements.
Sure add the other method that splits the the single string on semi-colons
for convenience but I still think the TrinoHook run methods should be fixed.
--
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]