You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I implemented a custom connection where I want the host, port, login, and password fields to always have constant values. To achieve this, I overrode the get_connection and aget_connection methods and injected those constant values.
This approach works correctly for synchronous calls within my hook (i.e., when running on a worker). However, it does not behave as expected in asynchronous contexts (i.e., when running in the triggerer). In those cases, the connection fields appear to be empty instead of using the values I set.
My hook inherited HttpAsyncHook
What you think should happen instead?
I guess the root cause is in this helper function:
Although aget_connection is a @classmethod, calling it through the literal BaseHook class short-circuits the MRO — Python dispatches straight to BaseHook's implementation and the subclass override is never consulted.
@mfatemipour, can you share the code that you authored (or a snip of it)? I think this will help us troubleshoot a bit further. At face value, the currently implementation of get_async_connection is not a problem. I'd be curious to see what you've written.
Activity
jroachgolf84 commentedon May 13, 2026
@mfatemipour, can you share the code that you authored (or a snip of it)? I think this will help us troubleshoot a bit further. At face value, the currently implementation of
get_async_connectionis not a problem. I'd be curious to see what you've written.