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

   #74406 added `test_async_do_api_call_fetches_connection_asynchronously`, 
which fails in the Compat 2.11.1 and Compat 3.0.6 provider test jobs on `main` 
and on every open PR:
   
   ```
   TypeError: multiple values for argument 'conn_id'
   ```
   
   The test assumed the hook always awaits `aget_connection`, which `BaseHook` 
only has from Airflow 3.1. Before that, `get_async_connection` runs 
`get_connection` in a worker thread, which is the Airflow 3.0 fix #74406 made. 
The test forbade any `get_connection` call, and its autospecced mock of the 
inherited classmethod receives the hook as `conn_id` when called on an 
instance, hence the `TypeError`.
   
   The mock now raises the AsyncToSync error only when `get_connection` runs on 
the event loop thread, as Airflow 3.0 does, and otherwise returns the real 
connection. The test passes on Airflow built from `main` and on Airflow 3.0.6 
with provider wheels built from this branch, and still fails with the 
AsyncToSync error if the hook's async connection lookup is removed.
   
   related: #74406
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.5) 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