o-nikolas commented on code in PR #62227:
URL: https://github.com/apache/airflow/pull/62227#discussion_r2842747218
##########
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:
This was added by Andrey in #35163 and there was definitely hesitation from
us on the PR but he talked us into it. We could remove this now if we think
it's too restrictive but perhaps just adding an exclusion for this one
[here](https://github.com/apache/airflow/blob/42cb911345d157dac27aa89d3524a696ece3b69b/providers/amazon/tests/unit/amazon/aws/hooks/test_hooks_signature.py#L30)
would be best? That way we can keep this base level of tidy signatures but
allow exceptions like this one.
--
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]