yuqian90 commented on a change in pull request #4182: [AIRFLOW-3336] Add new 
TriggerRule that will consider skipped ancestors as success 
URL: https://github.com/apache/airflow/pull/4182#discussion_r361069293
 
 

 ##########
 File path: airflow/ti_deps/deps/trigger_rule_dep.py
 ##########
 @@ -152,6 +152,11 @@ def _evaluate_trigger_rule(
             elif tr == TR.ONE_FAILED:
                 if upstream_done and not (failed or upstream_failed):
                     ti.set_state(State.SKIPPED, session)
+            elif tr == TR.NONE_FAILED:
+                if upstream_failed or failed:
+                    ti.set_state(State.UPSTREAM_FAILED, session)
+                elif skipped == upstream:
 
 Review comment:
   Pls note that this can be a feature worth preserving, because if someone 
wants his task op2 to only run if at least some upstream tasks have succeeded 
(while others can be skipped), he can use "none_failed" to do that because 
that's exactly what this line does. 
   
   However, if he wants to have his task op2 succeed as long as none of the 
upstream tasks fail (either skipped for success), he can still use 
"none_failed" for it. The only workaround he needs to add is to introduce a 
DummyOperator that always succeeds directly upstream of op2.
   
   So we can keep this feature, but we should make it clear in the doc that if 
all the upstream tasks are skipped, a task marked with "none_failed" will be 
skipped. Pls let me know. i don't mind creating a PR to update the doc.

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


With regards,
Apache Git Services

Reply via email to