Skip to content

Improve deadline diagnostics for null DagRun fields - #71767

Open
fat-catTW wants to merge 4 commits into
apache:mainfrom
fat-catTW:fix-deadline-null-reference-log
Open

Improve deadline diagnostics for null DagRun fields#71767
fat-catTW wants to merge 4 commits into
apache:mainfrom
fat-catTW:fix-deadline-null-reference-log

Conversation

@fat-catTW

Copy link
Copy Markdown
Contributor

Why

DagRun-based deadline references can evaluate to None when the DagRun exists but the referenced timestamp column is unset, such as logical_date on manually triggered runs without -l.

Before this change, Airflow treated that None the same as a missing DagRun and logged a misleading “Could not find DagRun” warning. Deadline creation was then skipped without logging the actual reason, making the configuration hard to diagnose.

relates: #71750

Solution

Distinguish a missing DagRun row from a present DagRun with a NULL referenced column.

When deadline creation is skipped because the reference evaluates to None, log structured context including the Dag id, run id, deadline alert id, reference type, and the DagRun column required by built-in references.

Was generative AI tooling used to co-author this PR?
  • [X] Yes (please specify the tool below)

Generated-by: [Codex] following the guidelines


  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@ColtenOuOColtenOuO left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Thanks for your fix!

I noticed an edge case and noted it in the comment :D

Comment threadairflow-core/src/airflow/serialization/definitions/dag.py

@ColtenOuOColtenOuO left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! well done :D

@ferruzzi
ferruzzi self-requested a review August 19, 2026 20:39
@ferruzziferruzzi added this to the Airflow 3.3.2 milestone Aug 29, 2026
@ferruzziferruzzi added the backport-to-v3-3-test Backport to v3-3-test label Aug 29, 2026
@ferruzzi

Copy link
Copy Markdown
Contributor

Can you add a 1-line bugfix newsfragment? Other than that I think this LGTM and I want to get it merged before a handful of others while need to rebase on top of this fix.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:DAG-processingarea:deadline-alertsAIP-86 (former AIP-57)backport-to-v3-3-testBackport to v3-3-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@fat-catTW@ferruzzi@ColtenOuO