Skip to content

Handle Task instance history from task SDK #44952

Open
@amoghrajesh

Description

Body

Usage:

if ti.state == TaskInstanceState.RUNNING:
# If the task instance is in the running state, it means it raised an exception and
# about to retry so we record the task instance history. For other states, the task
# instance was cleared and already recorded in the task instance history.
from airflow.models.taskinstancehistory import TaskInstanceHistory
TaskInstanceHistory.record_ti(ti, session=session)

Metadata

Assignees

Type

No type

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions