airflow.providers.common.compat.connection

Functions

get_async_connection(conn_id[, hook])

Get an asynchronous Airflow connection that is backwards compatible.

get_async_extra_dejson(conn)

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:
Returns:

Connection

Return type:

airflow.providers.common.compat.sdk.Connection

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_dejson masks the extra’s secrets with a synchronous call to the supervisor, which raises DeadlockImminentError when 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 synchronous extra_dejson runs in a worker thread, where blocking on the supervisor is safe, the same way get_async_connection() falls back to get_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:

dict[str, Any]

Was this entry helpful?