uranusjr commented on code in PR #31153:
URL: https://github.com/apache/airflow/pull/31153#discussion_r1227909885


##########
airflow/models/skipmixin.py:
##########
@@ -218,10 +226,16 @@ def skip_all_except(
             for branch_task_id in list(branch_task_id_set):
                 
branch_task_id_set.update(dag.get_task(branch_task_id).get_flat_relative_ids(upstream=False))
 
-            skip_tasks = [t for t in downstream_tasks if t.task_id not in 
branch_task_id_set]
-            follow_task_ids = [t.task_id for t in downstream_tasks if 
t.task_id in branch_task_id_set]
+            skip_tasks = []
+            for t in downstream_tasks:
+                downstream_ti = dag_run.get_task_instance(  # type: 
ignore[union-attr]
+                    t.task_id, map_index=ti.map_index
+                )
+                if downstream_ti and t.task_id not in branch_task_id_set:
+                    skip_tasks.append((t.task_id, downstream_ti.map_index))

Review Comment:
   This can probably be rewritten into a list comprehension



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