-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR restructures the Mapped Operator and Mapped Task Group code to live in the Task SDK at definition time. The big thing this change _does not do_ is make it possible to execute mapped tasks via the Task Execution API server etc -- that is up next. There were some un-avoidable changes to the scheduler/expansion part of mapped tasks here. Of note: `BaseOperator.get_mapped_ti_count` has moved from an instance method on BaseOperator to be a class method. The reason for this was that with the move of more and more of the "definition time" code into the TaskSDK BaseOperator and AbstractOperator it is no longer possible to add DB-accessing code to a base class and have it apply to the subclasses. (i.e. `airflow.models.abstractoperator.AbstractOperator` is now _not always_ in the MRO for tasks. Eventually that class will be deleted, but not yet) On a similar vein XComArg's `get_task_map_length` is also moved to a single dispatch class method on the TaskMap model since now the definition time objects live in the TaskSDK, and there is no realistic way to get a per-type subclass with DB logic (i.e. it's very complex to end up with a PlainDBXComArg, a MapDBXComArg, etc. that we can attach the method too) For those who aren't aware, singledispatch (and singledispatchmethod) are a part of the standard library when the type of the first argument is used to determine which implementation to call. If you are familiar with C++ or Java this is very similar to method overloading, the one caveat is that it _only_ examines the type of the first argument, not the full signature.
- Loading branch information
Showing
68 changed files
with
2,892 additions
and
2,456 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
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
Oops, something went wrong.