Skip to content

Add airflowctl tasks failed-deps command - #69397

Merged
potiuk merged 1 commit into
apache:mainfrom
FrankYang0529:airflow-tasks-failed-deps
Jul 30, 2026
Merged

Add airflowctl tasks failed-deps command#69397
potiuk merged 1 commit into
apache:mainfrom
FrankYang0529:airflow-tasks-failed-deps

Conversation

@FrankYang0529

Copy link
Copy Markdown
Member
  • Add command airflowctl tasks failed-deps <dag_id> <task_id> <logical_date_or_run_id> [--map-index N].
  • TaskInstancesOperations with get and get_dependencies, auto-generating airflowctl taskinstances get / airflowctl taskinstances get-dependencies
  • Mark the core CLI command with @deprecated_for_airflowctl("airflowctl tasks failed-deps") and register it in test_command_deprecations.py.
  • Extract get_dag_run_by_run_id_or_logical_date to ctl/utils/dag_run.py (shared with dags state).

Was generative AI tooling used to co-author this PR?
  • Yes - Claude Code

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

Comment thread airflow-ctl/src/airflowctl/api/operations.py Outdated
Comment thread airflow-ctl/src/airflowctl/ctl/utils/dag_run.py Outdated
Comment thread airflow-ctl/tests/airflow_ctl/api/test_operations.py
Comment thread airflow-ctl/tests/airflow_ctl/ctl/commands/test_task_command.py Outdated
Comment thread airflow-ctl/tests/airflow_ctl/ctl/commands/test_task_command.py Outdated
@FrankYang0529
FrankYang0529 force-pushed the airflow-tasks-failed-deps branch from d86e94b to e7e524a Compare July 9, 2026 11:14
Comment thread airflow-ctl/src/airflowctl/ctl/utils/dag_run.py Outdated
Comment thread docs/spelling_wordlist.txt Outdated
@FrankYang0529
FrankYang0529 force-pushed the airflow-tasks-failed-deps branch 2 times, most recently from 90a8e35 to 343a44e Compare July 14, 2026 06:24
@FrankYang0529
FrankYang0529 force-pushed the airflow-tasks-failed-deps branch 2 times, most recently from 69024f8 to fab9833 Compare July 24, 2026 03:07
Comment thread airflow-ctl/src/airflowctl/api/operations.py Outdated
Signed-off-by: PoAn Yang <payang@apache.org>
@FrankYang0529
FrankYang0529 force-pushed the airflow-tasks-failed-deps branch from fab9833 to 9ebd57a Compare July 24, 2026 11:21
@potiuk
potiuk merged commit a69ef4c into apache:main Jul 30, 2026
97 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport failed to create: v3-3-test. View the failure log Run details

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-3-test Commit Link

You can attempt to backport this manually by running:

cherry_picker a69ef4c v3-3-test

This should apply the commit to the v3-3-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

@github-actions

Copy link
Copy Markdown
Contributor

Backport failed to create: airflow-ctl/v0-1-test. View the failure log Run details

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
airflow-ctl/v0-1-test Commit Link

You can attempt to backport this manually by running:

cherry_picker a69ef4c airflow-ctl/v0-1-test

This should apply the commit to the airflow-ctl/v0-1-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

@potiuk

potiuk commented Jul 30, 2026

Copy link
Copy Markdown
Member

Heads-up: I merged #69274 earlier today and it has just put this PR into conflict — apologies, the overlap wasn't obvious until I re-read both.

#69274 marked the tasks CLI commands as migrated, which included adding exactly the two things this PR also adds:

  • @deprecated_for_airflowctl("airflowctl tasks failed-deps") on task_failed_deps in airflow-core/src/airflow/cli/commands/task_command.py (now on main at line 265)
  • the matching (task_command.task_failed_deps, "airflowctl tasks failed-deps") entry in test_command_deprecations.py

This branch is ~168 commits behind main, so on rebase both will collide. The resolution is simply to drop them from this PR — they're already on main; the rest of the change is unaffected.

On the implementation itself, which I reviewed properly: it looks good. The exactly-one guard on run_id / --logical-date is right, _build_task_instance_path handles the map_index >= 0 case correctly against the -1 default, and the fallback that fetches the task instance to explain an empty dependency list — rather than implying "all dependencies met" — is a genuinely thoughtful touch that most CLI commands skip.

No further review comments from me; just the rebase.


Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants