KulykDmytro edited a comment on issue #10686:
URL: https://github.com/apache/airflow/issues/10686#issuecomment-713855548


   Another one example on 1.10.12 shows same behavior for downstream tasks 
despite of any `trigger_rule` set (`all_success`, `all_done`, `none_failed`, 
`none_failed_or_skipped`)
   ```
   import datetime as dt
   
   from airflow.models import DAG
   from airflow.operators.dummy_operator import DummyOperator
   from airflow.operators.latest_only_operator import LatestOnlyOperator
   from airflow.utils.dates import days_ago
   #from airflow.utils.trigger_rule import TriggerRule
   
   dag = DAG(
       dag_id='latest_only_with_trigger',
       schedule_interval=dt.timedelta(hours=4),
       start_date=days_ago(2),
       tags=['example']
   )
   
   latest_only = LatestOnlyOperator(task_id='latest_only', dag=dag)
   task0 = DummyOperator(task_id='task0', dag=dag)
   task1 = DummyOperator(task_id='task1', dag=dag)
   task2 = DummyOperator(task_id='task2', dag=dag)
   
   task0 >> [task1, task2]
   latest_only >> task1 
   tr_list =  ['all_success', 'all_done', 'none_failed', 
'none_failed_or_skipped']
   
   for tr in tr_list:
       taska = DummyOperator(dag=dag, task_id=f'taska_{tr}', trigger_rule=tr)
       taskb = DummyOperator(task_id=f'taskb_{tr_list.index(tr)}', dag=dag)
       taskc = DummyOperator(task_id=f'taskc_{tr_list.index(tr)}', dag=dag)
   
       task1 >> [taska, taskb] >> taskc
       task2 >> [taska, taskb]
   ```
   
![image](https://user-images.githubusercontent.com/34435869/96778564-8a68bd00-13f4-11eb-87a2-bdd584fd766b.png)
   


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

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


Reply via email to