airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] BasPH commented on a change in pull request #4071: [AIRFLOW-3237] Refactor example DAGs
Date Mon, 22 Oct 2018 18:42:52 GMT
BasPH commented on a change in pull request #4071: [AIRFLOW-3237] Refactor example DAGs
URL: https://github.com/apache/incubator-airflow/pull/4071#discussion_r226975344
 
 

 ##########
 File path: airflow/example_dags/example_skip_dag.py
 ##########
 @@ -37,23 +33,15 @@ def execute(self, context):
         raise AirflowSkipException
 
 
-dag = DAG(dag_id='example_skip_dag', default_args=args)
-
-
 def create_test_pipeline(suffix, trigger_rule, dag):
-
     skip_operator = DummySkipOperator(task_id='skip_operator_{}'.format(suffix), dag=dag)
-
     always_true = DummyOperator(task_id='always_true_{}'.format(suffix), dag=dag)
-
     join = DummyOperator(task_id=trigger_rule, dag=dag, trigger_rule=trigger_rule)
-
-    join.set_upstream(skip_operator)
-    join.set_upstream(always_true)
-
     final = DummyOperator(task_id='final_{}'.format(suffix), dag=dag)
-    final.set_upstream(join)
+
+    [skip_operator, always_true] >> join >> final
 
 Review comment:
   Whoops my bad. Checked the `BaseOperator.__rshift__` and that accepts a single task or
List of tasks for the `other` object. But obviously calling rshift on a Python List doesn't
work :-) Will fix.

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


With regards,
Apache Git Services

Mime
View raw message