-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Fix GoogleBaseAsyncHook initialization to properly call parent init #60601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix GoogleBaseAsyncHook initialization to properly call parent init #60601
Conversation
|
Hello @OscarLigthart, thank you for your PR! I have checked this solution in my local Breeze environment by running |
Yeah I think that's a much cleaner solution. I reverted my change that was exactly like this, but passing on the |
|
@shahar1 Can you please check the change? |
|
Thanks for the reviews! Can someone merge this PR? I don't have the rights. |
Context
After upgrading to 3.1.6, we started seeing the following error in our GKEStartPodOperator execution, running in
deferredmode:_event_polling_fallbackattribute #60600Problem
After some research it looks like it's a result of the addition of the
_event_polling_fallbackin the AsyncKubernetesHook. This is never initialized in theGKEKubernetesAsyncHook, because theAsyncKubernetesHookinit method is never called, due to disruption of the MRO chain.With the current initialization of
GKEKubernetesAsyncHook, the MRO is:GKEKubernetesAsyncHookGoogleBaseAsyncHook-> Doesn't callsuper().__init__(), so it stops hereAsyncKubernetesHookKubernetesHookBaseHookAs stated, the initialization stops after 2 due to a missing
super().__init__(). Hence, the_event_polling_fallbackmethod is never added.Solution
I figured it would be less invasive to explicitly call both init methods. We could also consider adding the
super().__init__()call toGoogleBaseAsyncHook. This area is relatively new to me, so I'm very open to discuss this!Though the latter feels more invasive, it also feels like a more proper solution.
EDIT: latter solution doesn't work as it will pass the
gcp_conn_idandimpersonation_chainto the BaseHook.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Sonnet 4.5 following the guidelines
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.