vincbeck commented on code in PR #62227:
URL: https://github.com/apache/airflow/pull/62227#discussion_r2833616307
##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/athena_sql.py:
##########
@@ -70,7 +70,13 @@ class AthenaSQLHook(AwsBaseHook, DbApiHook):
supports_autocommit = True
def __init__(self, athena_conn_id: str = default_conn_name, *args,
**kwargs) -> None:
- super().__init__(*args, **kwargs)
+ # AwsGenericHook.__init__() only accepts these kwargs. Connection
extras
+ # like s3_staging_dir and work_group are not constructor params — they
are
+ # read later from the connection in get_conn().
BaseSQLOperator.get_hook()
+ # passes all connection extras as kwargs, so we must filter them out
here.
+ _aws_generic_hook_kwargs = {"aws_conn_id", "verify", "region_name",
"client_type", "resource_type", "config"}
+ filtered_kwargs = {k: v for k, v in kwargs.items() if k in
_aws_generic_hook_kwargs}
Review Comment:
Instead of doing that, can you declare these parameters in the constructor?
That would avoid doing a filtering
--
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]