henry3260 commented on code in PR #59104:
URL: https://github.com/apache/airflow/pull/59104#discussion_r2877113183


##########
airflow-core/src/airflow/models/taskinstance.py:
##########
@@ -1897,6 +1897,27 @@ def xcom_pull(
             ).first()
             if first is None:  # No matching XCom at all.
                 return default
+
+            # Check if the task is actually mapped
+            target_task_id = task_ids if isinstance(task_ids, str) else 
first.task_id
+            is_actually_mapped = False
+            # Get the task definition from the DAG
+            if self.task and self.task.dag:
+                dag = self.task.dag
+                if dag.has_task(target_task_id):
+                    target_task = dag.task_dict[target_task_id]
+                    is_actually_mapped = bool(getattr(target_task, 
"is_mapped", False))

Review Comment:
   > I traced this a bit, it looks like the bug was introduced in 
[aaaea35](https://github.com/apache/airflow/commit/aaaea355d3adf430204d01f8fdb3bfafbd7c2bd9)
   > 
   > It should likely be enough to simply add this back: 
[aaaea35#diff-62f7d8a52fefdb8e05d4f040c6d3459b4a56fe46976c24f68843dbaeb5a98487L637-R607](https://github.com/apache/airflow/commit/aaaea355d3adf430204d01f8fdb3bfafbd7c2bd9#diff-62f7d8a52fefdb8e05d4f040c6d3459b4a56fe46976c24f68843dbaeb5a98487L637-R607)
   > 
   > (Also remove the two comment lines below)
   
   Applied!



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