Skip to content

Fix 'airflow dags next-execution --table' crash when no next run exists#67642

Merged
pierrejeambrun merged 2 commits into
apache:mainfrom
GayathriSrividya:fix/dag-next-execution-table-none-67394
Jun 3, 2026
Merged

Fix 'airflow dags next-execution --table' crash when no next run exists#67642
pierrejeambrun merged 2 commits into
apache:mainfrom
GayathriSrividya:fix/dag-next-execution-table-none-67394

Conversation

@GayathriSrividya

@GayathriSrividya GayathriSrividya commented May 28, 2026

Copy link
Copy Markdown
Contributor

closes: #67394

`airflow dags next-execution --table` crashes with `AttributeError` when the DAG has `schedule=None` or `@once` (when requesting more than one execution via `--num-executions`).

The `--table` code path applied `attrgetter` to every yielded object from `iter_next_dagrun_info()` without checking for `None` first. The non-table path already had the correct `if info is None` guard. This fix mirrors the same guard in the table path and prints a warning to stderr instead of crashing.

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks you for the PR.

Can you clean the branch please, there seems to be an unrelated commit in here.

Comment thread airflow-core/newsfragments/67394.bugfix.rst Outdated
@GayathriSrividya
GayathriSrividya force-pushed the fix/dag-next-execution-table-none-67394 branch 6 times, most recently from 8bd14bc to 6d9bccf Compare June 2, 2026 16:23
@GayathriSrividya
GayathriSrividya force-pushed the fix/dag-next-execution-table-none-67394 branch from 6d9bccf to 10ebea4 Compare June 3, 2026 07:29

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, tested and working as expected, thanks

@pierrejeambrun pierrejeambrun added this to the Airflow 3.2.3 milestone Jun 3, 2026
@pierrejeambrun
pierrejeambrun merged commit 7ec8fc9 into apache:main Jun 3, 2026
76 checks passed
@boring-cyborg

boring-cyborg Bot commented Jun 3, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-2-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-2-test PR Link

github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Jun 3, 2026
…ext run exists (apache#67642)

* Fix 'airflow dags next-execution --table' crash when no next run exists

* Remove unnecessary newsfragment for next-execution table crash fix as per review

---------
(cherry picked from commit 7ec8fc9)

Co-authored-by: GayathriSrividya <gayathrirajavarapu7@gmail.com>
Co-authored-by: Gayathri Srividya Rajavarapu <gayathrir@Gayathris-MacBook-Air.local>
pierrejeambrun pushed a commit that referenced this pull request Jun 3, 2026
…ext run exists (#67642) (#67949)

* Fix 'airflow dags next-execution --table' crash when no next run exists

* Remove unnecessary newsfragment for next-execution table crash fix as per review

---------
(cherry picked from commit 7ec8fc9)

Co-authored-by: GayathriSrividya <gayathrirajavarapu7@gmail.com>
Co-authored-by: Gayathri Srividya Rajavarapu <gayathrir@Gayathris-MacBook-Air.local>
@vatsrahul1001 vatsrahul1001 removed this from the Airflow 3.2.3 milestone Jun 8, 2026
@vatsrahul1001 vatsrahul1001 added this to the Airflow 3.3.0 milestone Jun 8, 2026
@GayathriSrividya
GayathriSrividya deleted the fix/dag-next-execution-table-none-67394 branch June 11, 2026 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

airflow dags next-execution --table crashes when no next run exists

3 participants