Respect async connection hook overrides#67440
Conversation
|
AI Spam! Review your PR descriptions! |
|
Thanks, you are right that the previous description was not good enough. I rewrote it to describe the concrete bug, the code path changed, and the exact local validation results. I will slow down and avoid batch-style Airflow submissions going forward. |
|
I also moved this to draft so it is not sitting in the review queue while I make sure the description and evidence meet the project expectations. |
|
@bobu-putheeckal — closing this for now since it's a draft that's been inactive for a few weeks. This is purely housekeeping to keep the review queue tidy — not a reflection on the change itself. When you're ready to pick it back up, just reopen this PR (or open a fresh one), rebase onto the latest See the PR quality criteria. Automated triage note drafted by an AI-assisted tool — may get things wrong; a real Apache Airflow maintainer is happy to help if you reopen. (why automated) Drafted-by: Claude Code (Opus 4.8); reviewed by @potiuk before posting |
Fixes: #66845
This PR fixes a narrow async hook dispatch issue in provider connection handling.
Problem
airflow.providers.common.compat.connection.get_async_connection()always resolved connections throughBaseHook. That means async hooks which intentionally overrideaget_connection()orget_connection()on a subclass can be bypassed when code reaches the shared async helper.The issue report calls this out for async provider hooks: subclass-specific connection resolution should still be honored in the async path.
What changed
get_async_connection()now accepts an optionalhook_classargument.BaseHook, preserving behavior for existing callers.HttpAsyncHook.config()passestype(self)so subclassaget_connection()/get_connection()overrides are reached through normal classmethod dispatch.Validation
I ran these checks locally:
No UI behavior is changed, so screenshots are not applicable.
Was generative AI tooling used to co-author this PR?
Generated-by: OpenAI Codex following https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions