shivaam opened a new pull request, #62227:
URL: https://github.com/apache/airflow/pull/62227

   ## What
   
   Fix `TypeError` when SQL operators (e.g., `SQLValueCheckOperator`) 
instantiate
   `AthenaSQLHook` with Athena-specific connection extras like `s3_staging_dir`
   and `work_group`.
   
   Closes: #55678
   
   ## Why
   
   `BaseSQLOperator.get_hook()` copies all `connection.extra_dejson` fields into
   `hook_params` and passes them as kwargs to the hook constructor.
   `AwsGenericHook.__init__()` has a strict signature (no `**kwargs`) and 
rejects
   unknown params, causing a `TypeError`.
   
   These Athena-specific params aren't needed in `__init__` — they're already
   read from `self.conn.extra_dejson` in `get_conn()`.
   
   ## How
   
   Use an allowlist of valid `AwsGenericHook.__init__()` params to filter kwargs
   before calling `super().__init__()`. This is more future-proof than a 
blocklist
   since `AwsGenericHook`'s signature is stable (40+ subclasses depend on it),
   while PyAthena can add new connection params at any time.
   
   ## Tests
   
   Added unit tests verifying:
   - Hook instantiation with Athena-specific kwargs doesn't raise TypeError
   - Valid AWS kwargs (aws_conn_id, region_name, verify) are still forwarded 
correctly
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes (please specify the tool below): Kiro
   
   Generated-by: Kiro following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
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]

Reply via email to