yuqian90 commented on issue #7276: [AIRFLOW-5391] Add a new dependency rule to 
evaluate branching result
URL: https://github.com/apache/airflow/pull/7276#issuecomment-583347659
 
 
   @ashb  @kaxil  @feluelle  @tooptoop4  Hoping to get a review here.
   
   I have updated the PR a bit. The logic is still the same, but the code that 
does the branching evaluation has been moved into a new dependency rule inside 
``ti_deps/deps/branch_dep.py``.
   
   When `BranchDep` is evaluated, it sets the state of a task to "SKIPPED" if 
it has a parent that decided to skip it.
   
   For example, this comes from "example_short_circuit_operatorschedule":
   
![image](https://user-images.githubusercontent.com/6637585/74024780-7eaba680-49dd-11ea-813f-09ca598e5f48.png)
   
   For a DAG that looks like this, `condition_is_False` decided to skip 
`false_1`. Before this PR, the problem is if someone clears `false_1`, it'll 
execute. This is very counter-intuitive for users:
   
![image](https://user-images.githubusercontent.com/6637585/74024872-af8bdb80-49dd-11ea-9e53-19f4f7c844df.png)
   
![image](https://user-images.githubusercontent.com/6637585/74024927-caf6e680-49dd-11ea-84f6-5548e8954b1c.png)
   
   
   After this PR, when the scheduler evaluates the dependency rules for 
`false_1`, `BranchDep` will skip `false_1` because it knows that the parent 
task `condition_is_False` had already decided to skip `false_1`. In other 
words, this makes the "skipped" status "sticky".
    
   So after this PR, the DAG will look like this after someone clears 
`false_1`. This is much more intuitive:
   
   
![image](https://user-images.githubusercontent.com/6637585/74024780-7eaba680-49dd-11ea-813f-09ca598e5f48.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


With regards,
Apache Git Services

Reply via email to