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.