Repository navigation
Fix Databricks async connection test on Airflow before 3.1 - #74427
Merged
potiuk merged 2 commits intoOct 7, 2026
Merged
Conversation
The test assumed the hook always awaits aget_connection, which BaseHook only has from Airflow 3.1. On older versions get_async_connection runs get_connection in a worker thread, so the Compat 2.11.1 and 3.0.6 provider jobs fail on main and every open PR. Failing only when get_connection runs on the event loop, which is what broke on Airflow 3.0, covers both paths.
aaron-y-chen
approved these changes
Oct 7, 2026
Contributor
There was a problem hiding this comment.
Thanks, LGTM!
The failing static checks job is unrelated to this PR: codespell is currently broken on main. I've opened #74430 to fix it; once that's merged, a rebase should get CI green.
potiuk
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#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 onmainand on every open PR:The test assumed the hook always awaits
aget_connection, whichBaseHookonly has from Airflow 3.1. Before that,get_async_connectionrunsget_connectionin a worker thread, which is the Airflow 3.0 fix #74406 made. The test forbade anyget_connectioncall, and its autospecced mock of the inherited classmethod receives the hook asconn_idwhen called on an instance, hence theTypeError.The mock now raises the AsyncToSync error only when
get_connectionruns on the event loop thread, as Airflow 3.0 does, and otherwise returns the real connection. The test passes on Airflow built frommainand 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?
Generated-by: Claude Code (Opus 5.5) following the guidelines