Skip to content

Add airflowctl task states-for-dag-run command - #67912

Closed
ibobgunardi wants to merge 3 commits into
apache:mainfrom
ibobgunardi:bobi/airflowctl-task-states-for-dag-run
Closed

ibobgunardi wants to merge 3 commits into
apache:mainfrom
ibobgunardi:bobi/airflowctl-task-states-for-dag-run

Conversation

@ibobgunardi

@ibobgunardi ibobgunardi commented Jun 2, 2026 •

Copy link
Copy Markdown

Summary

Adds airflowctl tasks states-for-dag-run for retrieving task instance states for a Dag run via the public task instances API.

Closes: #66175

What changed

  • Added TasksOperations.states_for_dag_run to call /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances
  • Added the tasks API client accessor
  • Added generated CLI output support and help text for the command
  • Added unit coverage and included the command in airflowctl integration command coverage

Tests

  • python -m ruff check airflow-ctl/src/airflowctl/api/operations.py airflow-ctl/src/airflowctl/api/client.py airflow-ctl/src/airflowctl/ctl/cli_config.py airflow-ctl/tests/airflow_ctl/api/test_operations.py airflow-ctl-tests/tests/airflowctl_tests/test_airflowctl_commands.py
  • python scripts/ci/prek/check_airflowctl_command_coverage.py
  • python scripts/ci/prek/check_airflowctl_help_texts.py
  • python -m pytest --confcutdir=airflow-ctl/tests/airflow_ctl/api airflow-ctl/tests/airflow_ctl/api/test_operations.py -k 'TasksOperations or DagRunOperations'

Important

🛠️ Maintainer triage note for @ibobgunardi · by @potiuk · 2026-06-17 14:51 UTC

Helpful heads-up from the maintainers — please address before this PR can be reviewed:

  • Static / docs checks failing (CI image checks / Static checks). Run them locally with prek run --all-files (or pre-commit run --all-files) and push the fixes.
  • See the Pull Request quality criteria.

The ball is in your court — you've been assigned to this PR. Fix the above, then mark it Ready for review.

Automated triage — may be imperfect; a maintainer takes the next look.

@boring-cyborg

boring-cyborg Bot commented Jun 2, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: [email protected]
    Slack: https://s.apache.org/airflow-slack

@ibobgunardi
ibobgunardi force-pushed the bobi/airflowctl-task-states-for-dag-run branch from 89f112b to 6871380 Compare June 2, 2026 18:45

@bugraoz93 bugraoz93 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.

We should make same as the Airflow core CLI. This looks like just a list operation

@potiuk
potiuk marked this pull request as draft June 18, 2026 21:47
@potiuk

potiuk commented Jul 2, 2026

Copy link
Copy Markdown
Member

Note

🗑️ Closing stale draft · by @potiuk · 2026-07-02 18:44 UTC

This draft has been inactive for ~14 days. Closing to keep the queue tidy — no judgment on the change itself. Please reopen (or open a fresh PR) whenever you pick it back up, and a maintainer will be glad to take a look.

Automated triage — may be imperfect.

@potiuk potiuk closed this Jul 2, 2026
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.

[AIP-94] airflowctl tasks: add states-for-dag-run command

3 participants