airflow.providers.common.compat.connection¶
Functions¶
|
Get an asynchronous Airflow connection that is backwards compatible. |
|
Get the connection's extra as a dict, asynchronously and backwards compatible. |
Package Contents¶
- async airflow.providers.common.compat.connection.get_async_connection(conn_id, hook=None)[source]¶
Get an asynchronous Airflow connection that is backwards compatible.
- Parameters:
conn_id (str) – The provided connection ID.
hook (airflow.providers.common.compat.sdk.BaseHook | type[airflow.providers.common.compat.sdk.BaseHook] | None) – Hook (class or instance) to resolve the connection through, so a subclass override of
aget_connection/get_connectionis honored. Defaults toBaseHook.
- Returns:
Connection
- Return type:
- async airflow.providers.common.compat.connection.get_async_extra_dejson(conn)[source]¶
Get the connection’s extra as a dict, asynchronously and backwards compatible.
The async counterpart of
Connection.extra_dejson, for hooks running on an event loop (async tasks, triggers).extra_dejsonmasks the extra’s secrets with a synchronous call to the supervisor, which raisesDeadlockImminentErrorwhen another async call is in flight on the same event loop.On Airflow 3.3.2+ this awaits
Connection.aextra_dejson(), which masks the secrets asynchronously. On older versions the synchronousextra_dejsonruns in a worker thread, where blocking on the supervisor is safe, the same wayget_async_connection()falls back toget_connection.- Parameters:
conn (airflow.providers.common.compat.sdk.Connection) – The connection, e.g. from
get_async_connection().- Returns:
The deserialized extra, with its secrets masked.
- Return type: