uranusjr commented on code in PR #31927:
URL: https://github.com/apache/airflow/pull/31927#discussion_r1233697796
##########
airflow/models/baseoperator.py:
##########
@@ -1838,6 +1839,38 @@ def cross_downstream(
task.set_downstream(to_tasks)
+def chain_linear(*elements: DependencyMixin | Sequence[DependencyMixin]):
+ """
+ Helper to simplify task dependency definition.
+
+ E.g.: suppose you want precedence like so::
+
+ ╭─op2─╮ ╭─op4─╮
+ op1─┤ ├─├─op5─┤─op7
+ ╰-op3─╯ ╰-op6─╯
+
+ Then you can accomplish like so::
+
+ chain_linear(
+ op1,
+ [op2, op3],
+ [op4, op5, op6],
+ op7
+ )
+
+ Args:
+ elements: a list of operators / lists of operators
Review Comment:
```suggestion
:param elements: a list of operators / lists of operators
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]