Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to set tags=[] to remove all tags from a DAG. #20468

Closed
1 of 2 tasks
ReadytoRocc opened this issue Dec 22, 2021 · 5 comments
Closed
1 of 2 tasks

Need to set tags=[] to remove all tags from a DAG. #20468

ReadytoRocc opened this issue Dec 22, 2021 · 5 comments
Labels
Milestone

Comments

@ReadytoRocc
Copy link
Contributor

Apache Airflow version

2.2.3 (latest released)

What happened

When removing the tags argument from a DAG, the tags are not removed. You need to set tags=[] to remove them.

What you expected to happen

I would expect that if you remove the tags argument from the DAG definition, all tags would be removed from the DAG.

How to reproduce

Add tags=["foo"] to your DAG definition, and then remove the argument entirely. The DAG should still have tag foo in the UI. You should see the tag removed once you set tags=[].

Operating System

Debian GNU/Linux 11 (bullseye)

Versions of Apache Airflow Providers

No response

Deployment

Other Docker-based deployment

Deployment details

Astronomer CLI Docker based deployment.

Anything else

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@ReadytoRocc ReadytoRocc added area:core kind:bug This is a clearly a bug labels Dec 22, 2021
@PApostol
Copy link
Contributor

I think this has already been fixed on main by changing self.tags = tags to self.tags = tags or [] in airflow/models/dag.py (the change is not in Airflow 2.2.3 though). Can you check the issue against main?

@potiuk
Copy link
Member

potiuk commented Dec 23, 2021

Oh yeah. Some nice side-effect of Our #19891 quest with MyPY.

It's been fixed here:

#20272

@ReadytoRocc - I am closing the issue now - but if you could double-check if it is really fixed, it would be great.

(we can always re-open the issue if you find it's not fixed).

@potiuk potiuk closed this as completed Dec 23, 2021
@potiuk potiuk added this to the Airflow 2.3.0 milestone Dec 23, 2021
@ReadytoRocc
Copy link
Contributor Author

@PApostol @potiuk confirmed that this is working as expected on main. Thanks!

@potiuk
Copy link
Member

potiuk commented Dec 23, 2021

@PApostol @potiuk confirmed that this is working as expected on main. Thanks!

Glad to hear!

@EugeneChung
Copy link

EugeneChung commented Dec 19, 2022

You can remove tags from the dag_tag table or you can truncate the table because all of the tags will be regenerated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants