KulykDmytro opened a new issue #11819:
URL: https://github.com/apache/airflow/issues/11819


   **Apache Airflow version**: 1.10.12
   **Kubernetes version**: 1.18.6
   **What happened**:
   Forwarded from https://github.com/apache/airflow/issues/10686
   In case when LatestOnlyOperator set as upstream all downstreams tasks are 
being skipped despite of `trigger_rule` set to any of `all_done`, 
`none_failed`, `none_failed_or_skipped`. It behaves same as `all_success` which 
is contradicts with 
[documentation](https://airflow.apache.org/docs/stable/concepts.html?highlight=branch#latest-run-only)
   
   ```python
       t_ready = DummyOperator(
           task_id = 'calc_ready',
           trigger_rule = 'none_failed',
           dag=dag)
   ```
   
![image](https://user-images.githubusercontent.com/34435869/97078846-c91a9500-15f7-11eb-8328-1f37730fb650.png)
   
   PS: This is a repeating issue which seems to be fixed with AIRFLOW-4453 has 
been returned back (at least in 1.10.12)
   PR: #7464
   
   **What you expected to happen**:
   Behavior should correspond to 
[documentation](https://airflow.apache.org/docs/stable/concepts.html?highlight=branch#latest-run-only)
 and not cascade `skipped` status as per 
[here](https://airflow.apache.org/docs/stable/concepts.html?highlight=branch#trigger-rules)
   ```
   Skipped tasks will cascade through trigger rules `all_success` and 
`all_failed` but not `all_done`, `one_failed`, `one_success`, `none_failed`, 
`none_failed_or_skipped`, `none_skipped` and `dummy`. 
   ```
   **How to reproduce it**:
   ```python
   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_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]
   ```
   
https://user-images.githubusercontent.com/34435869/96783110-18917300-13f6-11eb-927c-331d8c22dd72.png
   
   **Anything else we need to know**:
   Anyhow behavior not corresponds with [documentation 
](https://airflow.apache.org/docs/stable/concepts.html?highlight=branch#latest-run-only)
   Even using a code snippet mentioned there receiving non-expected result 
(task4 being skipped)
   
![image](https://user-images.githubusercontent.com/34435869/97078879-1139b780-15f8-11eb-9a90-be03fd2c3f07.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:
[email protected]


Reply via email to