Add tasks clear command to airflowctl#66852
Conversation
| mail_folder: str = "INBOX", | ||
| mail_filter: str = "All", | ||
| not_found_mode: str = "raise", | ||
| overwrite: bool = True, |
There was a problem hiding this comment.
related to this PR - #66850
Could you please remove these unrelated chnages
| const utc = parsed.toISOString(); | ||
| setDisplayDate(local); | ||
| onChange?.({ ...event, target: { ...event.target, value: utc } } as unknown as ChangeEvent<HTMLInputElement>); | ||
| }; |
Add TasksOperations and TaskInstancesOperations to the API layer, a tasks clear command to airflowctl, and register the tasks command group in the CLI. The clear command supports optional --start-date and --end-date flags in ISO format. Closes apache#66176
e6a0496 to
ba07330
Compare
|
Sorry I mixed up. Should be good now |
|
Fixed the CI/static-check failures from the What changed:
Verification:
Drafted-by: Claude Code (Opus 4.7); reviewed by @kyupark before posting |
|
CI |
Include `tasks` in the capture snapshot list so CI help-image checks stay in sync after adding `tasks clear`. Co-authored-by: Cursor <cursoragent@cursor.com>
|
CI is green now |
There was a problem hiding this comment.
Thanks! Good to add the image help script but we need to move the logic to operations.py as the cli command will be autogenerated we need to add help text to yaml definition
https://github.com/apache/airflow/blob/main/airflow-ctl/src/airflowctl/ctl/help_texts.yaml
|
|
||
| @provide_api_client(kind=ClientKind.CLI) | ||
| def clear(args, api_client=NEW_API_CLIENT) -> None: | ||
| """Clear task instances for a Dag.""" |
There was a problem hiding this comment.
This should be in operations.py since we can call with single endpoint and we don't need to maintain this much LoC
bugraoz93
left a comment
There was a problem hiding this comment.
I saw what you separated over routes, but we need Airflow core CLI parity rather. So we should combine them under tasks only and then name them accordingly. Same as the Asset get and get_alias, we can do get() and for Tasks route we can name it differently, as they are per dag. Like g
| """Operations related to tasks.""" | ||
| return TasksOperations(self) | ||
|
|
||
| @lru_cache() # type: ignore[prop-decorator] |
There was a problem hiding this comment.
This needs to be gone because we removed other parts and it should stay as tasks
|
@kyupark — I've removed the Automated triage note drafted by an AI-assisted tool — may get things wrong; a real Apache Airflow maintainer takes the next look once they're resolved. (why automated) Drafted-by: Claude Code (Opus 4.8); reviewed by @potiuk before posting |
|
@kyupark — There are 2 unresolved review thread(s) on this PR from @bugraoz93. Could you either push a fix or reply in each thread explaining why the feedback doesn't apply? Once you believe the feedback is addressed, mark the thread as resolved so the reviewer isn't re-pinged needlessly. Thanks! 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. |
Add a
tasks clearcommand to airflowctl, allowing users to clear task instances via the CLI.Supports
--dag-id,--task-id,--start-date, and--end-dateflags. Uses thePOST /api/v2/dags/{dag_id}/clearTaskInstancesendpoint.closes: #66176
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.7) following the guidelines
Important
🛠️ Maintainer triage note for @kyupark · by
@potiuk· 2026-07-08 15:51 UTCSome review feedback from
@potiukis waiting on you (4 unresolved threads):The ball is in your court — you've been assigned to this PR. Reply or push a fix in each thread, then mark them resolved. See the Pull Request quality criteria.
Automated triage — may be imperfect; a maintainer takes the next look.