uranusjr commented on a change in pull request #20286:
URL: https://github.com/apache/airflow/pull/20286#discussion_r783194609



##########
File path: airflow/models/taskinstance.py
##########
@@ -2128,6 +2138,14 @@ def set_duration(self) -> None:
             self.duration = None
         self.log.debug("Task Duration set to %s", self.duration)
 
+    def _record_task_map_for_downstreams(self, value: Any, *, session: 
Session) -> None:
+        if not self.task.has_mapped_dependants():
+            return
+        if not isinstance(value, collections.abc.Collection) or 
isinstance(value, (bytes, str)):
+            self.log.info("Failing %s for unmappable XCom push %r", self.key, 
value)
+            raise UnmappableXComPushed(value)

Review comment:
       Oh good point. Even doing `repr(value)[:100]` can potentially consume a 
lot of memory, so I guess the only reasonable approach is to not log the value 
at all. Worst case, the user can manually look up that problematic value in the 
XCom table.




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