airflowctl: add tasks state command (closes #66174)#66384
Conversation
Signed-off-by: noahwons <noahwons@gmail.com>
|
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
|
|
ci looks failed. https://github.com/apache/airflow/actions/runs/25358208398/job/74471164072?pr=66384 |
|
@noahwons A few things need addressing before review — see our Pull Request quality criteria. Issues found:
What to do next:
No rush — take your time. We appreciate your contribution and are happy to wait for updates. If you have questions, feel free to ask on the Airflow Slack. Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you. |
|
@noahwons A few things need addressing before review — see our Pull Request quality criteria.
No rush. Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you. Drafted-by: Claude Code (Opus 4.7); reviewed by @potiuk before posting |
Title
airflowctl: add
tasks states-for-dag-runcommand (closes #66175)Body
Closes #66175.
Builds on top of #______ (PR for issue #66174 —
tasks state).What this PR does
Adds the
airflowctl tasks states-for-dag-runsubcommand. Given a DAG ID and a DAG run ID, prints a table of all task instances in that run, with their current state, start/end timestamps, and (where applicable) map index. Replicates the legacyairflow tasks states-for-dag-runCLI behavior over the REST API.Implementation summary
list_states_for_dag_runmethod on theTasksOperationsclass added in #______, wrappingGET /dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances. Uses the existingBaseOperations.execute_listhelper for automatic pagination.states_for_dag_runcommand function inairflow-ctl/src/airflowctl/ctl/commands/tasks_command.py.ActionCommandregistered in the existingTASKS_COMMANDStuple incli_config.pywithname="states-for-dag-run".test_tasks_command.pyexercising the happy path with a mocked REST response.airflow-ctl/newsfragments/.Testing
pytest airflow-ctl/tests/airflow_ctl/ctl/commands/test_tasks_command.py::TestTasksCommands::test_tasks_states_for_dag_run -v— passes.AI-assistance disclosure
Per the project's contribution policy: this PR was developed with AI assistance for code drafting and analysis. All code has been reviewed, manually tested by the contributor, and the contributor can explain and defend the changes during review.