eladkal commented on code in PR #23971:
URL: https://github.com/apache/airflow/pull/23971#discussion_r924898304
##########
airflow/providers/trino/hooks/trino.py:
##########
@@ -255,32 +257,38 @@ def get_pandas_df(
@overload
def run(
self,
- sql,
+ sql: Union[str, Iterable[str]],
autocommit: bool = False,
- parameters: Optional[Tuple] = None,
+ parameters: Optional[Union[Iterable, Mapping]] = None,
handler: Optional[Callable] = None,
- ) -> None:
+ split_statements: bool = False,
+ return_last: bool = True,
+ ) -> Optional[Union[Any, List[Any]]]:
"""Execute the statement against Trino. Can be used to create views."""
@overload
def run(
self,
- sql,
+ sql: Union[str, Iterable[str]],
autocommit: bool = False,
- parameters: Optional[Tuple] = None,
+ parameters: Optional[Union[Iterable, Mapping]] = None,
handler: Optional[Callable] = None,
+ split_statements: bool = False,
+ return_last: bool = True,
hql: str = "",
- ) -> None:
+ ) -> Optional[Union[Any, List[Any]]]:
""":sphinx-autoapi-skip:"""
def run(
self,
- sql,
+ sql: Union[str, Iterable[str]],
autocommit: bool = False,
- parameters: Optional[Tuple] = None,
+ parameters: Optional[Union[Iterable, Mapping]] = None,
handler: Optional[Callable] = None,
+ split_statements: bool = False,
Review Comment:
In Trino, Presto, Snowflake it doesnt make sense to have it as False.
I think the risk is only teoritical. I cant think of an actual example where
this is going to break user code but if we want to be on the safe side (and I
guess we should) can we maybe deprecate the default value of false and in next
major release change it to True?
My argument here is that if we don't set it as True for these providers -
users will have to set it to True in **all** usages.
--
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]