airflow.providers.common.ai.durable.storage

ObjectStorage-backed storage for the durable execution journal (Airflow < 3.3).

Attributes

log

SECTION

Classes

DurableStorage

Stores the durable journal in a single JSON file on ObjectStorage.

Module Contents

airflow.providers.common.ai.durable.storage.log[source]
airflow.providers.common.ai.durable.storage.SECTION = 'common.ai'[source]
class airflow.providers.common.ai.durable.storage.DurableStorage(*, dag_id, task_id, run_id, map_index=-1)[source]

Stores the durable journal in a single JSON file on ObjectStorage.

All journal steps are stored as entries in a single JSON blob, written to {base_path}/{cache_id}.json where cache_id is a hash of the task instance’s identity (dag, task, run, map index) so distinct task instances never share a file.

The file survives Airflow task retries since it lives outside the XCom system. delete_steps() removes the steps of a run that succeeded, and the file once nothing is left in it.

Parameters:
  • dag_id (str) – DAG ID of the running task.

  • task_id (str) – Task ID of the running task.

  • run_id (str) – DAG run ID.

  • map_index (int) – Map index for mapped tasks (-1 for non-mapped).

save_step(key, entry)[source]

Store one journal step and rewrite the journal file.

Returns:

True if the entry was written, False if it could not be encoded.

Return type:

bool

load_step(key)[source]

Load one journal step, or None when there is none or it is not a journal entry.

delete_steps(keys)[source]

Remove these steps, and the journal file once nothing is left in it.

Was this entry helpful?