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

   Fix RuntimeError when using async operators in triggerer environment.
   
   ## Problem
   
   When `DatabricksExecutionTrigger` or async operators use 
`BaseDatabricksHook` in the triggerer (where an event loop is running), it 
causes:
   
   ```
   RuntimeError: You cannot use AsyncToSync to run a loop in the same thread as 
AsyncSync
   ```
   
   ## Root Cause
   
   Async methods in `BaseDatabricksHook` were using the synchronous 
`databricks_conn` property which calls `BaseHook.get_connection()`. When called 
from within a running event loop, this causes the RuntimeError.
   
   ## Solution
   
   - Add `aget_connection()` async method wrapping `BaseHook.aget_connection()`
   - Add `a_databricks_conn` async property for async connection access
   - Add async helper methods: `_a_get_connection_attr()`, `_a_endpoint_url()`, 
`_a_is_aws_federation()`, `_a_get_required_client_id()`
   - Update all async methods to use the new async connection properties
   - Fix typo in proxies validation (`invalid_ckeys` -> `invalid_keys`)
   - Update `_a_get_aad_token()` to catch `aiohttp.ClientResponseError` instead 
of `requests.HTTPError`
   
   ## Tests
   
   Added comprehensive async tests including:
   - `test_async_do_api_call_respects_schema`
   - `test_async_do_api_call_only_existing_response_properties_are_read`
   
   ---
   
   Generated-by: Claude Code (Opus 5)


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