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

   ### Under which category would you file this issue?
   
   Providers
   
   ### Apache Airflow version
   
   3.2.0 (also reproduced on 3.2.1)
   
   ### What happened and how to reproduce it?
   
   Branching inside a TaskGroup does not reliably prevent non-selected 
downstream tasks from running.
   Even when branch callable returns a specific task_id, sibling downstream 
tasks still get scheduled/run.
   In our production setup (KubernetesExecutor), this causes unnecessary pod 
starts and resource waste.
   
   Minimal example (TaskFlow + TaskGroup + branch):
   ```python
   from airflow.sdk import DAG, task, task_group
   from airflow.providers.standard.operators.empty import EmptyOperator
   from airflow.sdk.bases.operator import chain
   from pendulum import datetime
   with DAG(
       dag_id="repro_branch_taskgroup_32x",
       start_date=datetime(2026, 1, 1),
       schedule=None,
       catchup=False,
   ):
       @task_group(group_id="g")
       def g():
           @task.branch(task_id="choose")
           def choose():
               return "g.path_a"
           @task(task_id="path_a")
           def path_a():
               print("A")
           @task(task_id="path_b")
           def path_b():
               print("B should be skipped")
           end = EmptyOperator(task_id="end")
           c = choose()
           a = path_a()
           b = path_b()
           chain(c, [a, b], end)
       g()
   
   ### What you think should happen instead?
   
   Only selected downstream branch task(s) should run.
   All non-selected downstream tasks should be marked skipped before execution.
   
   
   ### Operating System
   
   _No response_
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Apache Airflow Provider(s)
   
   _No response_
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Official Helm Chart version
   
   1.18.0
   
   ### Kubernetes Version
   
   v1.32.4
   
   ### Helm Chart configuration
   
   _No response_
   
   ### Docker Image customizations
   
   _No response_
   
   ### Anything else?
   
   **Environment**
   Executor: KubernetesExecutor
   Python: 3.13
   Deployment: Docker/Kubernetes
   DAG contains TaskGroup and mapped workloads in real case
   
   ### Are you willing to submit PR?
   
   - [ ] 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: [email protected]

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

Reply via email to