Add airflowctl tasks clear command#66926
Conversation
|
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
|
|
Text is malformed, can you fix that? |
|
Thanks for pointing that out @vincbeck! It was a formatting issue caused by my terminal escaping the markdown backticks during submission. I've just updated the PR title and description, and it should be properly formatted now. |
bugraoz93
left a comment
There was a problem hiding this comment.
Could you please add unit tests and integrations tests under airflow-ctl-test/?
|
Thanks for the review @bugraoz93! I had actually already included the integration test for |
This commit introduces the TasksOperations class to airflowctl/api/operations.py and wires it up to the Client, which allows the dynamic generation of the �irflowctl tasks clear CLI command. It also includes integration tests. Closes apache#66176
a992af5 to
bcad3cc
Compare
bugraoz93
left a comment
There was a problem hiding this comment.
On a second looks this should trigger help image generation and some more.
Can you please check the scripts generationg the images for the tasks and new command
|
Could you please also add def here |
Hi @bugraoz93, Thank you for the catch! I have updated the PR to fully support help text definitions and help image generation for the new
Please let me know if there's anything else that needs addressing before review! |
| tasks:8ca7306be97d1c8788dbfbe4b0f8bf61 | ||
| auth login:9fe2bb1dd5c602beea2eefb33a2b20a8 | ||
| tasks clear:151c473a0b6653553149513b46e58072 | ||
|
|
There was a problem hiding this comment.
This should be autogenerated, seems something went wrong
There was a problem hiding this comment.
We also have two entry should be one
There was a problem hiding this comment.
Thank you for catching that @bugraoz93! You're right on both points:I had mistakenly added "tasks clear" to the SUBCOMMANDS list in run_capture_airflowctl_help.py, which caused the file to be generated with two entries (tasks and tasks clear) instead of just one.I've reverted that- only "tasks" is now registered under COMMANDS (matching the pattern used by all other top-level command groups). The command_hashes.txt now has a single correct entry for tasks, and output_tasks_clear.svg has been removed.
The file has been regenerated correctly and both prek checks pass. Sorry for the noise!
70f27f3 to
df8ebfd
Compare
df8ebfd to
3be6196
Compare
Closes #66176
This PR introduces the
airflowctl tasks clearcommand to the new Airflow CLI interface, satisfying the requirements of AIP-94.Changes:
TasksOperationstoairflow-ctl/src/airflowctl/api/operations.pythat mapsclearto the core API'sPOST /api/v2/dags/{dag_id}/clearTaskInstancesendpoint.tasksproperty in theClientto automatically generate the command and its arguments viacli_config.py.tasks clear example_bash_operatorintest_airflowctl_commands.py.