You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/10/26 23:14:10 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #27250: Add note about pushing the lazy XCom proxy to XCom

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


##########
docs/apache-airflow/concepts/dynamic-task-mapping.rst:
##########
@@ -72,6 +72,17 @@ The grid view also provides visibility into your mapped tasks in the details pan
 
     You can use normal sequence syntax on this object (e.g. ``values[0]``), or iterate through it normally with a ``for`` loop. ``list(values)`` will give you a "real" ``list``, but please be aware of the potential performance implications if the list is large.
 
+    Note that the same also applies to when you push this proxy object into XCom. This, for example, would not
+    work with the default XCom backend:
+
+    .. code-block:: python
+
+        @task
+        def forward_values(values):
+            return values  # This is a lazy proxy and can't be pushed!
+
+    You need to explicitly call ``list(values)`` instead, and accept the performance implications.

Review Comment:
   It entirely depends on what the user pushes into the XCom and how the data is stored so there’s no way to really describe fully. All the normal XCom caveats apply, times how many upstream tasks were mapped into.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org