kmehkeri opened a new issue, #37091:
URL: https://github.com/apache/airflow/issues/37091

   ### Apache Airflow version
   
   2.8.1
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   When a task that uses dynamic task mapping has `trigger_rule='none_failed'` 
and depends on a task that was skipped, it fails with `upstream_failed` status.
   
![image](https://github.com/apache/airflow/assets/6439875/f8288d8e-d226-4a00-b8a7-acdab60def95)
   
   
   ### What you think should happen instead?
   
   The dynamic task should be skipped as well (this happens with 
`trigger_rule='all_success'`.
   
   ### How to reproduce
   
   ```
   import random
   
   from airflow.decorators import dag, task
   import datetime
   
   @dag(
       start_date=datetime.datetime(2021, 1, 1),
       schedule=None,
   )
   def branch_with_mapping():
       @task
       def random_fun():
           import random
           return random.randrange(-10, 10) > 0
   
       @task.branch
       def branching(x):
           if x is True:
               return "true_branch"
           else:
               return "false_branch"
   
       @task
       def true_branch():
           print("True")
           return [1, 2, 3]
   
       @task
       def false_branch():
           print("False")
   
       @task(trigger_rule='none_failed')
       def echo(i):
           print(i)
   
       t = true_branch()
       branching(random_fun()) >> [t, false_branch()]
       echo.expand(i=t)
   
   branch_with_mapping()
   ```
   
   ### Operating System
   
   Using official Airflow Docker image in standalone mode
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other Docker-based deployment
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
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: commits-unsubscr...@airflow.apache.org.apache.org

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

Reply via email to