pierrejeambrun commented on code in PR #28001:
URL: https://github.com/apache/airflow/pull/28001#discussion_r1036290838


##########
docs/apache-airflow/concepts/dynamic-task-mapping.rst:
##########
@@ -296,8 +296,93 @@ Similar to ``expand``, you can also map against a XCom 
that returns a list of di
         task_id="copy_files", source_bucket_name=list_filenames.bucket
     ).expand_kwargs(copy_kwargs)
 
-Filtering items from an expanded task
-=====================================
+Mapping over a task group
+=========================
+
+Similar to a TaskFlow task, you can also call either ``expand`` or 
``expand_kwargs`` on a ``@task_group``-decorated function to create a mapped 
task group:
+
+.. note:: Implementations of individual tasks in this section are omitted for 
brevity.
+
+.. code-block:: python
+
+    @task_group
+    def file_transforms(filename):
+        return convert_to_yaml(filename)
+
+
+    file_transforms.expand(filename=["data1.json", "data2.json"])
+
+In the above example, task ``convert_to_yaml`` is expanded into two task 
instances at runtime. The first expanded would receive ``"data1.json"`` as 
input, and the second ``"data2.json"``.
+
+.. note:: Arguments passed to a mapped task group is a proxy, not real values
+
+    Different from task functions (``@task``), a task group function is 
evaluated eagerly, and only once when the DAG is parsed. This means that 
parameters passed into the function is only a placeholder, and not a real 
value. For example, this will *not* work:

Review Comment:
   Maybe we can elaborate a bit more on this. I feel like this is a important 
point that may be hard to understand.



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