feat(airflowctl): add task instance management support#61946
feat(airflowctl): add task instance management support#61946Suraj-kumar00 wants to merge 10 commits into
Conversation
Implements TaskInstanceOperations for get, list, clear, and update. Adds task_instances property to Client and integration tests. Closes: apache#61547 Signed-off-by: Suraj <suraj.ukumar.p@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 (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
|
Hi @shahar1, Please review |
bugraoz93
left a comment
There was a problem hiding this comment.
Thanks for the PR and it looks good! We were going to release new version which delayed a week and some breaking changes needs to be fixes here #61822. Lets hold adding more feature for a couple of days as and decide how to go with schema evolution and we can fit this into new release :)
Sure @bugraoz93, thanks for the update! Let me know if i can help you with anything from my end. |
dheerajturaga
left a comment
There was a problem hiding this comment.
Hi @Suraj-kumar00 ! Thanks for contributing and adding the new suite of commands! While @bugraoz93 works on the cleaning up the schema changes, there are few things which would make this PR complete. Would you be able to add unit tests for these commands? I have included an example in the comments which you can use as a reference.
Also, Could you please take a moment to set up and run the static code checks outlined in this document?
https://github.com/apache/airflow/blob/39b914b6775507a5d7420278af5e5eba1272fa24/contributing-docs/08_static_code_checks.rst
Running these locally is highly beneficial because it automatically catches and often fixes formatting issues or simple errors before you push your changes. This saves you from waiting on long CI builds, guarantees your code will pass the automated pipeline, and keeps the code review focused on your actual logic rather than stylistic nitpicks. Let me know if you run into any issues setting it up!
- Add comprehensive TestTaskInstanceOperations unit test suite (6 tests) - Add clear and update integration tests in test_airflowctl_commands.py - Add clear to output_command_list in cli_config.py Signed-off-by: Suraj <suraj.ukumar.p@gmail.com>
…com:Suraj-kumar00/airflow into feat/add-task-instance-cli-support
|
Thanks for the detailed review @dheerajturaga! I've addressed all the feedback:
All 6 unit tests pass locally. Let me know if there's anything else! |
Thanks for adding the tests! 😃 I also see that the airflowctl checks are failing. Please address them as well |
- Change taskinstance update test to use --note instead of --new-state to avoid flaky "already in failed state" server error - Apply ruff formatting fixes from prek - Regenerate airflowctl CLI help SVG (output_main.svg) via prek hook Signed-off-by: Suraj <suraj.ukumar.p@gmail.com>
|
Hi @dheerajturaga, Please review... |
The Airflow API server-side validation requires new_state to be non-empty. Using --note alone causes: "Value error, new_state should not be empty". Changed to --new-state=success which is a valid transition from failed state. Signed-off-by: Suraj <suraj.ukumar.p@gmail.com>
cd62c99 to
2af1cb8
Compare
bugraoz93
left a comment
There was a problem hiding this comment.
Thanks for the PR! There are still integration tests failing. Could you please check that?
|
@Suraj-kumar00 please fix the CI checks? |
|
@Suraj-kumar00 This PR has been converted to draft because it does not yet meet our Pull Request quality criteria. Issues found:
What to do next:
Converting a PR to draft is not a rejection — it is an invitation to bring the PR up to the project's standards so that maintainer review time is spent productively. 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. |
|
Could you please approve the PR i believe it needs your approval in-order to run those CI tests, please approve so that i can proceed fixing it. Thanks |
|
No. We cannot approve it. FOr some reason your PR gets canceled. I recommend to re-open it, but approval will not change its status. Let me close it now - open a new one @Suraj-kumar00 |
Adds Task Instance management support to the airflowctl CLI, enabling users to get, list, clear, and update task instances directly from the terminal.
closes: #61547
Changes
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
New CLI Commands
Was generative AI tooling used to co-author this PR?
Generated-by: Gemini following the guidelines
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.