spire-mike opened a new issue #17097:
URL: https://github.com/apache/airflow/issues/17097


   I am experimenting with the `LatestOnlyOperator` in Airflow 1.10.15. The 
[documentation 
shows](https://airflow.apache.org/docs/apache-airflow/1.10.15/concepts.html#latest-run-only)
 an example dag with the following code:
   
   ```
   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)
   task1 = DummyOperator(task_id='task1', dag=dag)
   task2 = DummyOperator(task_id='task2', dag=dag)
   task3 = DummyOperator(task_id='task3', dag=dag)
   task4 = DummyOperator(task_id='task4', dag=dag, 
trigger_rule=TriggerRule.ALL_DONE)
   
   latest_only >> task1 >> [task3, task4]
   task2 >> [task3, task4]
   ```
   
   And the following image which is meant to show which tasks get skipped and 
which ones run:
   
   [![enter image description here][1]][1]
   
   When I copy the code from the documentation exactly as it's shown, and load 
the DAG into my airflow setup, I get the following results:
   
   [![enter image description here][2]][2]
   
   As you can see, this is different than the results the documentation 
indicate I should expect. In my runs, `task4` is skipped every time, except the 
latest, but I would expect it to run due to the 'all_done' trigger rule as the 
documentation suggests. According to the documentation, a skip should not 
cascade to an 'all_done' trigger rule.
   
   Does anyone have any idea why this is happening? I am copying and pasting 
from the documentation exactly as they shown:
   
   
https://airflow.apache.org/docs/apache-airflow/1.10.15/concepts.html#latest-run-only
   
   
   
   
     [1]: https://i.stack.imgur.com/SGxHZ.png
     [2]: https://i.stack.imgur.com/Jfdbs.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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to