Skip to content

Support to delete datasets used in Data Aware Scheduling #36308

Closed

Description

@sai3563

Description

Hi All,

I am extensively using Data Aware Scheduling in my projects. One thing I've noticed is that in the UI or via code, there is no button/function to delete datasets. It would be great if we can add a function to do the same and also a button in UI to delete it.

Use case/motivation

In my case, I am generating dags dynamically which also creates datasets. The configs, stored in MongoDB, creates the dags. Often, we add and remove such configs. On removal, their dags disappear but datasets remain. Deletion option of dataset will help maintain cleanliness in the Datasets page for me and I'm sure many others in the future.

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:feature
    needs-triage
    on Dec 19, 2023
  2. added
    area:UI
    and removed
    needs-triage
    on Dec 19, 2023
  3. added
    area:API
    on Dec 19, 2023
  4. im-perativa commented on Jan 7, 2024

    @im-perativa
    Contributor

    @bbovenzi can I work on this?

  5. im-perativa commented on Jan 12, 2024

    @im-perativa
    Contributor

    Often, we add and remove such configs. On removal, their dags disappear but datasets remain. Deletion option of dataset will help maintain cleanliness in the Datasets page for me and I'm sure many others in the future.

    @sai3563 I would like to clarify, did you mean the datasets remain on both UI and database or database only? Because from what I can see orphaned dataset are not shown in the UI.

    Unless force deletion of unorphaned dataset is possible and meaningful (it will recreated in next DAG code scan anyway cmiiw) I'm not sure if we need to add delete button in UI. I do agree with delete function using API though and I'm working on it.

  6. sai3563 commented on Jan 12, 2024

    @sai3563
    Author

    @im-perativa I just checked again and found that orphaned datasets continue to show up in the UI.

    I'm on Airflow 2.7.3. Not sure if anything has changed after that in regards to datasets, but here is how this works for me.

    I use configs in MongoDB to make dynamic dags. Let's say 200 documents in MongoDB = 200 dags in Airflow. Based on the name of the dag, datasets are also created.

    Now I add 1 document, so now I have 201 dags and I run the newly added dag. Dataset of the new dag gets updated. Now if I remove that config from Mongo, dag in airflow of that document also gets deleted. But dataset of it remains.

  7. added
    area:data-aware-scheduling
    and removed on Mar 25, 2025
  8. bbovenzi commented on Apr 22, 2025

    @bbovenzi
    Contributor

    Testing this in Airflow 3. If you remove an asset from the dag code, it will also be removed from the assets list in the UI when the dag bundle is reparsed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:APIarea:UIarea:data-aware-schedulingkind:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions