The GitHub Actions job "Tests (AMD)" on 
airflow.git/fix-task-duration-skipped-61849 has succeeded.
Run started by GitHub user myps6415 (triggered by eladkal).

Head commit for run:
f77d66f4c1c97028292992e1c37f82d15891fb95 / John Tung <[email protected]>
Fix missing task.duration metric for skipped tasks

task.duration (and its registry-derived legacy name
dag.<dag_id>.<task_id>.duration) was emitted for tasks ending in
SUCCESS or FAILED but missing for SKIPPED tasks, despite being
documented as available for all terminal states.

The metric is emitted from finalize() in the Task SDK task_runner,
gated on `if ti.start_date and ti.end_date:`. The SUCCESS and FAILED
exception handlers set ti.end_date on the local RuntimeTaskInstance
before constructing the outbound TaskState message, so the guard
passes. The AirflowSkipException handler (and the SKIPPED branch of
DagRunTriggerException with skip_when_already_exists=True) set
end_date only on the outbound TaskState message, leaving
ti.end_date as None — so finalize()'s guard failed and the metric
was never emitted for skipped tasks.

Set ti.end_date on the local instance in both SKIPPED handlers,
mirroring the AirflowFailException and _handle_current_task_success
patterns. The TaskState message references ti.end_date to keep the
local instance and the outbound message in sync.

Report URL: https://github.com/apache/airflow/actions/runs/26872322452

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to