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 13:37:55 UTC

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

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


##########
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:
   This invites the question of what implications and how can you tell if it's dramatic or not.
   If this is something we discourage under any circumstances I would use a stronger language



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