Skip to content

Commit fbed9e5

Browse files
committed
Narrow log_extra scope for skipped intervals callback in request
Skipped intervals fires when no Dag run is made, so it will have no run_id. The former implementation expected a run_id in the request.
1 parent f321060 commit fbed9e5

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

airflow-core/src/airflow/dag_processing/processor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,10 @@ def _execute_callbacks(
335335
"run_id": request.ti.run_id,
336336
"ti_id": str(request.ti.id),
337337
}
338-
else:
338+
elif isinstance(request, DagCallbackRequest):
339339
log_extra = {"dag_id": request.dag_id, "run_id": request.run_id}
340+
else:
341+
log_extra = {"dag_id": request.dag_id}
340342
# context_from_server can carry user-supplied run conf, and the masker cannot
341343
# redact inside an already-serialized string, so keep it out of log payloads.
342344
request_json = request.to_json(exclude={"context_from_server"})

task-sdk/src/airflow/sdk/execution_time/schema/versions/v2026_10_30.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class AddArgBindingsToSupervisorTIRunContext(VersionChange):
4444

4545

4646
class AddDagSkippedIntervalsCallbackRequest(VersionChange):
47-
"""Introduce ``DagSkippedIntervalsCallbackRequest`` in the ``CallbackRequest`` union."""
47+
"""Introduce ``DagSkippedIntervalsCallbackRequest`` in ``CallbackRequest`` union."""
4848

4949
description = __doc__
5050

0 commit comments

Comments
 (0)