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/12/13 07:30:07 UTC

[GitHub] [airflow] amoghrajesh commented on a diff in pull request #28325: Adding an example dag for dynamic task mapping

amoghrajesh commented on code in PR #28325:
URL: https://github.com/apache/airflow/pull/28325#discussion_r1046745512


##########
docs/apache-airflow/concepts/dynamic-task-mapping.rst:
##########
@@ -30,27 +30,7 @@ Simple mapping
 
 In its simplest form you can map over a list defined directly in your DAG file using the ``expand()`` function instead of calling your task directly.
 
-.. code-block:: python
-
-    from datetime import datetime
-
-    from airflow import DAG
-    from airflow.decorators import task
-
-
-    with DAG(dag_id="simple_mapping", start_date=datetime(2022, 3, 4)) as dag:
-
-        @task
-        def add_one(x: int):
-            return x + 1
-
-        @task
-        def sum_it(values):
-            total = sum(values)
-            print(f"Total was {total}")
-
-        added_values = add_one.expand(x=[1, 2, 3])
-        sum_it(added_values)
+If you want to see a simple usage of Dynamic Task Mapping, you can look at the ``example_dynamic_task_mapping.py`` example DAG that comes with Airflow.

Review Comment:
   Made the required changes. Can you have a look again?



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