ron819 commented on a change in pull request #4071: [AIRFLOW-3237] Refactor 
example DAGs
URL: https://github.com/apache/incubator-airflow/pull/4071#discussion_r227752052
 
 

 ##########
 File path: airflow/example_dags/example_xcom.py
 ##########
 @@ -63,12 +61,21 @@ def puller(**kwargs):
 
 
 push1 = PythonOperator(
-    task_id='push', dag=dag, python_callable=push)
+    task_id='push',
+    dag=dag,
+    python_callable=push,
+)
 
 push2 = PythonOperator(
-    task_id='push_by_returning', dag=dag, python_callable=push_by_returning)
+    task_id='push_by_returning',
+    dag=dag,
+    python_callable=push_by_returning,
+)
 
 pull = PythonOperator(
-    task_id='puller', dag=dag, python_callable=puller)
+    task_id='puller',
+    dag=dag,
+    python_callable=puller,
+)
 
-pull.set_upstream([push1, push2])
+pull << [push1, push2]
 
 Review comment:
   > @ron819 Setting dependencies with a tuple of tasks will also work because 
in `_set_relatives` the right-hand object is simply converted to a list 
([code](https://github.com/apache/incubator-airflow/blob/39a9365b6250e588363e59dd6e332e02a28f411d/airflow/models.py#L3064)).
   
   Maybe this should be added to the docs as well as it isn't written anywhere.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to