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 Wed, 24 Oct 2018 06:55:50 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_r227661886
 
 

 ##########
 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:
   There is a chapter on bitshift composition in the docs: [link here](https://airflow.apache.org/concepts.html?highlight=set_downstream#bitshift-composition).
   
   However, the tutorial chapter indeed uses the `set_downstream` and `set_upstream` methods.
I will check the documentation tonight and check where and how dependencies are set throughout
the documentation.
   
   Also, passing a list of tasks (e.g. `task1 >> [task2, task3]`) is something I learned
from the example DAGs but I don't see it anywhere in the docs. Will update the docs on how
dependencies can be set.

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