diff --git a/airflow/models/dagrun.py b/airflow/models/dagrun.py index c601193b272d9..35d4e1b61e88d 100644 --- a/airflow/models/dagrun.py +++ b/airflow/models/dagrun.py @@ -866,7 +866,7 @@ def _emit_true_scheduling_delay_stats_for_finished_state(self, finished_tis: lis ordered_tis_by_start_date = [ti for ti in finished_tis if ti.start_date] ordered_tis_by_start_date.sort(key=lambda ti: ti.start_date, reverse=False) - first_start_date = ordered_tis_by_start_date[0].start_date + first_start_date = ordered_tis_by_start_date[0].start_date if ordered_tis_by_start_date else None if first_start_date: # TODO: Logically, this should be DagRunInfo.run_after, but the # information is not stored on a DagRun, only before the actual