amoghrajesh commented on code in PR #51568:
URL: https://github.com/apache/airflow/pull/51568#discussion_r2139753381


##########
task-sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -338,19 +338,34 @@ def xcom_pull(
             run_id = self.run_id
 
         single_task_requested = isinstance(task_ids, (str, type(None)))
-        single_map_index_requested = isinstance(map_indexes, (int, type(None), 
ArgNotSet))
+        single_map_index_requested = isinstance(map_indexes, (int, type(None)))
 
         if task_ids is None:
             # default to the current task if not provided
             task_ids = [self.task_id]
         elif isinstance(task_ids, str):
             task_ids = [task_ids]
 
-        map_indexes_iterable: Iterable[int | None] = []
-        # If map_indexes is not provided, default to use the map_index of the 
calling task
+        # If map_indexes is not specified, pull xcoms from all map indexes for 
each task
         if isinstance(map_indexes, ArgNotSet):
-            map_indexes_iterable = [self.map_index]
-        elif isinstance(map_indexes, int) or map_indexes is None:
+            xcoms = []
+            for t_id in task_ids:
+                values = XCom.get_all(
+                    run_id=run_id,
+                    key=key,
+                    task_id=t_id,
+                    dag_id=dag_id,
+                )
+                xcoms.extend(values)

Review Comment:
   Yea sure, if its performant, we can do it.



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