Skip to content

Add airflowctl tasks state command#66213

Open
PrithviBadiga wants to merge 6 commits into
apache:mainfrom
PrithviBadiga:prithvi/airflowctl-task-state
Open

Add airflowctl tasks state command#66213
PrithviBadiga wants to merge 6 commits into
apache:mainfrom
PrithviBadiga:prithvi/airflowctl-task-state

Conversation

@PrithviBadiga
Copy link
Copy Markdown
Contributor

Adds airflowctl tasks state to the airflow-ctl CLI.

Updates:

  • add airflowctl.ctl.commands.task_command.state
  • call GET /api/v2/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}
  • print the task instance state via AirflowConsole
  • wire the command in cli_config.py
  • add a focused unit test for the command output
  • add the command to the airflowctl-tests command list

Verification:

  • PYTHONPATH=/Users/prith/Desktop/Codex/airflow-66174/airflow-ctl/src /Users/prith/Desktop/Codex/airflow/.venv/bin/python -m pytest /Users/prith/Desktop/Codex/airflow-66174/airflow-ctl/tests/airflow_ctl/ctl/commands/test_task_command.py /Users/prith/Desktop/Codex/airflow-66174/airflow-ctl/tests/airflow_ctl/ctl/test_cli_config.py -q
  • PYTHONPATH=/Users/prith/Desktop/Codex/airflow-66174/airflow-ctl/src /Users/prith/Desktop/Codex/airflow/.venv/bin/python -m ruff check /Users/prith/Desktop/Codex/airflow-66174/airflow-ctl/src/airflowctl/ctl/commands/task_command.py /Users/prith/Desktop/Codex/airflow-66174/airflow-ctl/src/airflowctl/ctl/cli_config.py /Users/prith/Desktop/Codex/airflow-66174/airflow-ctl/tests/airflow_ctl/ctl/commands/test_task_command.py /Users/prith/Desktop/Codex/airflow-66174/airflow-ctl-tests/tests/airflowctl_tests/test_airflowctl_commands.py

This closes: #66174

@hyungryuk
Copy link
Copy Markdown

@PrithviBadiga Hi! It looks like we've opened overlapping PRs for the same issue. It would be great if we could discuss our differences and see how to best combine our work.

@hyungryuk
Copy link
Copy Markdown

@PrithviBadiga Why don't you check out my PR and share your thoughts? Then, we could look into making a co-authored commit together.

@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label May 5, 2026
@potiuk potiuk removed the ready for maintainer review Set after triaging when all criteria pass. label May 18, 2026
@potiuk potiuk marked this pull request as draft May 18, 2026 10:47
@potiuk
Copy link
Copy Markdown
Member

potiuk commented May 18, 2026

@PrithviBadiga — Removing the ready for maintainer review label and converting back to draft. The branch now has merge conflicts with main that surfaced after the label was added.

The label's contract is that the PR is ready for maintainer review — a regression like this means the PR temporarily isn't. Rebase your branch onto the latest main, resolve conflicts, then mark "Ready for review" again to re-enter the queue.

git fetch upstream main && git rebase upstream/main, resolve, git push --force-with-lease. See the working-with-git docs.

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.

@PrithviBadiga PrithviBadiga force-pushed the prithvi/airflowctl-task-state branch from a9b8826 to 00f5566 Compare May 18, 2026 15:26
@PrithviBadiga
Copy link
Copy Markdown
Contributor Author

maintainer review

@potiuk xRebased onto the latest main, resolved the merge conflicts, and force-pushed the branch.

@PrithviBadiga PrithviBadiga marked this pull request as ready for review May 19, 2026 15:34
@PrithviBadiga PrithviBadiga force-pushed the prithvi/airflowctl-task-state branch from ea341c5 to b9835a3 Compare May 19, 2026 22:28
Copy link
Copy Markdown
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

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

Could you please move the logic to operations.py? You can check out examples there

Comment thread airflow-ctl/src/airflowctl/ctl/commands/task_command.py Outdated
Comment thread airflow-ctl/src/airflowctl/ctl/cli_config.py Outdated
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 state command

4 participants