forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use set instead of list for dags' tags (apache#41695)
* Started working on dag tags, moved the tags to set, and added atest to check duplications. * Fixed more areas of the c'tor. * Fixed test of dag tags. * Added a check to see if the tags are mutable. * Added newsfragment. * Removed unecessary check. * Removed str specification at the type, for compatability with python 3.8. * Removed more type specification as part of compatability with python 3.8 * Fixed the newsfragment. * Added missing word. * Used `` for code segemnts at the rst file. * Reformatted the file. * Fixed wrong method for adding tag. * Added type hinting at the dag bag. * Deserialized the tags to set. * Adjusted the tests for the set type. * Added type hinting. * Sorting the tags by name. * Changed to typing. * Update newsfragments/41420.significant.rst Co-authored-by: Jens Scheffler <[email protected]> * Update newsfragments/41420.significant.rst Co-authored-by: Jens Scheffler <[email protected]> * Removed the generic specification at the dag args expected types, as it raises the error: Subscripted generics cannot be used with class and instance checks. * Added tags to the expected serialized DAG. * Added sorting the tags keys by the name key. * Fixed sorting tags by name to use `sorted` instead of `.sort` * Fixed tags comparesion, as it's now a set, and not a list. --------- Co-authored-by: Jens Scheffler <[email protected]>
- Loading branch information
1 parent
ba1c602
commit bdab7dc
Showing
9 changed files
with
82 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
**Breaking Change** | ||
|
||
Replaced Python's ``list`` with ``MutableSet`` for the property ``DAG.tags``. | ||
|
||
At the constractur you still can use list, | ||
you actually can use any data structure that implements the | ||
``Collection`` interface. | ||
|
||
The ``tags`` property of the ``DAG`` model would be of type | ||
``MutableSet`` instead of ``list``, | ||
as there are no actual duplicates at the tags. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters