Skip to content

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

Open
GayathriSrividya wants to merge 3 commits into
apache:mainfrom
GayathriSrividya:fix/dag-next-execution-table-none-67394
Open

Fix 'airflow dags next-execution --table' crash when no next run exists#67642
GayathriSrividya wants to merge 3 commits into
apache:mainfrom
GayathriSrividya:fix/dag-next-execution-table-none-67394

Conversation

@GayathriSrividya
Copy link
Copy Markdown

`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.

closes: #67394


Was generative AI tooling used to co-author this PR?
  • Yes — GitHub Copilot (Claude Sonnet 4.6)

Generated-by: GitHub Copilot (Claude Sonnet 4.6) following the guidelines

Gayathri Srividya Rajavarapu added 2 commits May 28, 2026 15:15
… multiple DAGs

When a single import-error file mapped to N DAGs, the previous query
JOINed ParseImportError with file_dags_cte producing N rows per error.
paginated_select then counted those N rows, inflating total_entries and
applying LIMIT/OFFSET against joined rows rather than distinct errors.

Fix uses a two-query approach:
1. dedup_stmt with DISTINCT - one row per import error for correct count
   and pagination via paginated_select
2. import_errors_stmt - full join only for the paginated IDs to gather
   dag_id associations for authorization/stacktrace redaction

Closes apache#67525
Copy link
Copy Markdown
Member

@pierrejeambrun pierrejeambrun left a comment

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
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

2 participants