Skip to content

Update taskinstance clear endpoint to support mapped tasks #44867

Closed

Description

@eladkal

Body

We are missing clear endpoint in the taskinstance api

We need the endpoint to have same functionality as clear button in the UI.
Note: The task needs to accommodate both clearing a task and clearing a map index (when using dynamic task mapping)

for reference you can see previous PRs that added functionality to the Rest API: #41017, #39138

Update (after discussing in comments)

  1. Move clear endpoint from Dag to TaskInstance
  2. Add support for mapped index

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Activity

  1. added
    kind:feature
    area:API
    on Dec 12, 2024
  2. vatsrahul1001 commented on Dec 12, 2024

    @vatsrahul1001
    Contributor

    I can work on this. Assigning it to myself.

  3. vatsrahul1001 commented on Dec 12, 2024

    @vatsrahul1001
    Contributor

    @eladkal Should I also create an Issue to migrate this to FastAPI as well?

  4. eladkal commented on Dec 12, 2024

    @eladkal
    ContributorAuthor

    No need for another issue. You can simply start another PR directly

  5. vatsrahul1001 commented on Dec 17, 2024

    @vatsrahul1001
    Contributor

    @eladkal We do have taskinstance clear endpoint implementation already here. As per openapi spec its under DAG endpoint here.

    image

    In FastAPI we have correctly added this under taskinstances.
    image

    Do let me know if this is what you wanted in implementation, if yes should I move this endpoint from DAG to TaskInstance in legacy API?

  6. eladkal commented on Dec 17, 2024

    @eladkal
    ContributorAuthor

    Do let me know if this is what you wanted in implementation, if yes should I move this endpoint from DAG to TaskInstance in legacy API?

    In my perspective yes. I expect to find clear action on task instance endpoints but I think it's a good idea to track the PR added it and see if there was discussion around why it's placed there. We may be missing something.

    By the way, it seems like with current endpoint you are not able to clear a specific map index in a specific task instance so I think we need to add support for this.

  7. pierrejeambrun commented on Dec 18, 2024

    @pierrejeambrun
    Member

    Maybe we should close this one, or update it in favor of a feature request for a more fined grained clearing capabilities on 'mapped task instances' ?

    As I understand the endpoint exists, it just needs improvement ?

  8. eladkal commented on Dec 18, 2024

    @eladkal
    ContributorAuthor

    Maybe we should close this one, or update it in favor of a feature request

    In the wrong place. Its not intuitive to find it under DAGs. So this issue is about moving it and refactor it to support mapped tasks. @vatsrahul1001 do you need me to update issue description?

    Updated title and description

  9. changed the title [-]Add taskinstance clear endpoint to the rest api[/-] [+]Update taskinstance clear endpoint to support mapped tasks[/+] on Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions