shivaam commented on code in PR #62227:
URL: https://github.com/apache/airflow/pull/62227#discussion_r2844184282
##########
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:
Sounds good. Added exclusion and using constructor params now. Unit test
covers the actual issue that was reported in
https://github.com/apache/airflow/issues/55678
--
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]