Skip to content

spark_on_k8s.airflow.ui.backend

Implementation reference. These symbols describe how the project works; their presence here does not make them supported application imports. Use the documented entry points and support policy.

snapshot_for(connection, binding) async

Return a recent verified application snapshot shared by this task attempt's viewers.

Callers authorize the request and resolve its binding first. Only reads use this; actions always verify the current application themselves.

Source code in spark_on_k8s/airflow/ui/backend.py
188
189
190
191
192
193
194
195
196
197
async def snapshot_for(connection, binding: TaskBinding) -> ConsoleApplication:
    """Return a recent verified application snapshot shared by this task attempt's viewers.

    Callers authorize the request and resolve its binding first. Only reads use this;
    actions always verify the current application themselves.
    """
    key = snapshot_key(binding)
    if key is None:
        return await application_for(connection, binding)
    return await connection.app.state.snapshots.get(key, lambda: application_for(connection, binding))