You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/07/20 02:50:22 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #17099: Adding EdgeModifier support for chain()

uranusjr commented on a change in pull request #17099:
URL: https://github.com/apache/airflow/pull/17099#discussion_r672768216



##########
File path: airflow/models/baseoperator.py
##########
@@ -1546,13 +1546,17 @@ def inherits_from_dummy_operator(self):
         return getattr(self, '_is_dummy', False)
 
 
-def chain(*tasks: Union[BaseOperator, "XComArg", Sequence[Union[BaseOperator, "XComArg"]]]):
+def chain(
+    *tasks: Union[
+        BaseOperator, "XComArg", EdgeModifier, Sequence[Union[BaseOperator, "XComArg", EdgeModifier]]

Review comment:
       At this point we should make this `BaseOperator, "XComArg", EdgeModifier` thing a type alias, maybe something like
   
   ```python
   Chainable = Union[BaseOperator, "XComArg", EdgeModifier]
   def chain(*tasks: Union[Chainable, Sequence[Chainable]]) -> None:
       ...
   ```

##########
File path: airflow/models/baseoperator.py
##########
@@ -1546,13 +1546,17 @@ def inherits_from_dummy_operator(self):
         return getattr(self, '_is_dummy', False)
 
 
-def chain(*tasks: Union[BaseOperator, "XComArg", Sequence[Union[BaseOperator, "XComArg"]]]):
+def chain(
+    *tasks: Union[
+        BaseOperator, "XComArg", EdgeModifier, Sequence[Union[BaseOperator, "XComArg", EdgeModifier]]

Review comment:
       At this point we should make this `BaseOperator, "XComArg", EdgeModifier` thing a type alias, maybe something like
   
   ```python
   Chainable = Union[BaseOperator, "XComArg", EdgeModifier]
   
   def chain(*tasks: Union[Chainable, Sequence[Chainable]]) -> None:
       ...
   ```




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org