zhongjiajie commented on issue #8233: Dag tags use set instead of list
URL: https://github.com/apache/airflow/pull/8233#issuecomment-612595326
 
 
   Sorry for reply late due to have cold. @kaxil @BasPH I change dag tags from 
list to set due to two main reason:
   1. In 
https://github.com/apache/airflow/blob/6ba672eaab84fd71dc8a6f2dd5791651e5a96c38/airflow/models/dag.py#L1654-L1660
 we have unique key on `name and dag_id` but in 
https://github.com/apache/airflow/blob/6ba672eaab84fd71dc8a6f2dd5791651e5a96c38/airflow/models/dag.py#L234
 we define `tags` in list(which may contain duplicate element). Since each dag 
can not contain duplicate tag, should we define `Dag.tags` without duplicate 
element and using set would be a solution
   2. Users use tag when they define DAG file with set, them may came to their 
mind `DAG tags is a set and no duplicate element`. I think will be more clear. 
I know we will drop the duplicate element by code or database constraint, but 
maybe avoid it by user define side would be better.
   
   WDYT

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to