kandharvishnu commented on code in PR #49282:
URL: https://github.com/apache/airflow/pull/49282#discussion_r2046913022
##########
providers/common/sql/src/airflow/providers/common/sql/operators/sql.py:
##########
@@ -161,7 +161,12 @@ def get_hook(cls, conn_id: str, hook_params: dict | None =
None) -> BaseHook:
:param hook_params: hook parameters
:return: default hook for this connection
"""
+ hook_params = hook_params or {}
connection = BaseHook.get_connection(conn_id)
+ conn_params = connection.extra_dejson
Review Comment:
I cannot think of such scenario where adding extra value to hook_params
won't be solved by the existing hook_params parameter.
However, the purpose of this PR is to reduce redundancy. For instance, if
the `use_legacy_sql` parameter is already set to False in the BigQuery
connection, it should ideally be passed automatically to the
SQLExecuteQueryOperator. Otherwise, I'd need to manually set it to False in
every task — which becomes inefficient and error-prone, especially when dealing
with hundreds of tasks.
--
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]