Dag tags use set instead of list#8233
Conversation
Dag tags store in db without duplicate name in each dag, but list could contain duplicate elements, so it's better to change tags attr in Dag from list to set
Codecov Report
@@ Coverage Diff @@
## master #8233 +/- ##
==========================================
- Coverage 88.35% 88.05% -0.30%
==========================================
Files 936 936
Lines 45305 45316 +11
==========================================
- Hits 40030 39905 -125
- Misses 5275 5411 +136
Continue to review full report at Codecov.
|
kaxil
left a comment
There was a problem hiding this comment.
We don't need to do this: Check https://github.com/apache/airflow/pull/6489/files#r347050841
|
@kaxil I think it might be worth changing this call to a set: https://github.com/apache/airflow/blob/master/airflow/models/dag.py#L1532. It seems currently the DagTags are made unique when fetching from the DB. Other than that, we can close this pull request IMO. |
|
Sorry for reply late due to have cold. @kaxil @BasPH I change dag tags from list to set due to two main reason:
WDYT |
|
BTW, I submit this when I review bulk sync to database code in #8231 |
I think we can just change the line @BasPH mentioned (https://github.com/apache/airflow/blob/master/airflow/models/dag.py#L1532. ) to a |
Dag tags store in db without duplicate name in each
dag, but list could contain duplicate elements, so
it's better to change tags attr in Dag from list to
set
Make sure to mark the boxes below before creating PR: [x]
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.
Read the Pull Request Guidelines for more information.