eladkal commented on issue #10686:
URL: https://github.com/apache/airflow/issues/10686#issuecomment-864519884


   Tested latest main branch with the reproduced code:
   
   ```
   import random
   
   from airflow.models import DAG
   from airflow.operators.dummy import DummyOperator
   from airflow.operators.python import BranchPythonOperator
   from airflow.utils.dates import days_ago
   
   args = {
       'owner': 'Airflow',
       'start_date': days_ago(2),
   }
   
   dag = DAG(
       dag_id='branch_test_issue_10686',
       default_args=args,
       schedule_interval="@daily",
       tags=['example']
   )
   
   run_this_first = DummyOperator(
       task_id='run_this_first',
       dag=dag,
   )
   
   options = ['branch_a']
   
   branching = BranchPythonOperator(
       task_id='branching',
       python_callable=lambda: random.choice(options),
       dag=dag,
   )
   run_this_first >> branching
   
   join = DummyOperator(
       task_id='join',
       trigger_rule='none_failed',
       dag=dag,
   )
   
   for option in options:
       t = DummyOperator(
           task_id=option,
           dag=dag,
       )
   
       dummy_follow = DummyOperator(
           task_id='follow_' + option,
           dag=dag,
       )
   
       branching >> t >> dummy_follow >> join
   
   options.append('join')
   branching >> join
   ```
   
   The `branching` task gives:
   [2021-06-20, 08:33:47 UTC] {python.py:151} INFO - Done. Returned value was: 
branch_a
   [2021-06-20, 08:33:47 UTC] {skipmixin.py:124} INFO - Following branch 
branch_a
   [2021-06-20, 08:33:47 UTC] {skipmixin.py:155} INFO - Skipping tasks []
   
   
   ![Screen Shot 2021-06-20 at 11 37 
14](https://user-images.githubusercontent.com/45845474/122667513-e0784500-d1bb-11eb-9cf2-6efe03f3811f.png)
   
   This seems fine to me.
   Cloud the issue already been resolved?


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