This is an automated email from the ASF dual-hosted git repository.

kaxil pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new de420be1d68 Fix mapped-task retry policy example in tasks docs (#74343)
de420be1d68 is described below

commit de420be1d68a7305a7186327543b262e1e238d19
Author: Kaxil Naik <[email protected]>
AuthorDate: Tue Oct 6 18:37:58 2026 +0100

    Fix mapped-task retry policy example in tasks docs (#74343)
    
    The example used `@task.partial(...).expand(...)` as a decorator, which
    raises `AttributeError: task decorator 'partial' not found`. Show the
    `@task(retry_policy=...)` + `.expand()` form and the classic operator
    `.partial(retry_policy=...)` form instead.
---
 airflow-core/docs/core-concepts/tasks.rst | 27 +++++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/airflow-core/docs/core-concepts/tasks.rst 
b/airflow-core/docs/core-concepts/tasks.rst
index 2561d46b5b8..fd193333bab 100644
--- a/airflow-core/docs/core-concepts/tasks.rst
+++ b/airflow-core/docs/core-concepts/tasks.rst
@@ -251,19 +251,30 @@ Define a policy once and share it across DAGs via 
``default_args`` or a shared m
 Mapped tasks
 ~~~~~~~~~~~~
 
-Policies work with dynamic task mapping via ``.partial()``. The policy applies
-per mapped task instance -- if instance 2 of 10 hits FAIL, the other 9 continue
-independently:
+Policies work with dynamic task mapping. The policy applies per mapped task
+instance -- if instance 2 of 10 hits FAIL, the other 9 continue independently:
 
 .. code-block:: python
 
-    @task.partial(retry_policy=my_policy).expand(input=[1, 2, 3])
+    @task(retry_policy=my_policy)
     def my_mapped_task(input): ...
 
-The policy is set at the task level via ``.partial()``; all mapped instances
-share one policy. Per-index variation is not supported on ``.expand()``, but 
the
-policy's ``evaluate()`` method receives the exception, ``try_number``, and full
-context, so per-index branching can be done inside the policy if needed.
+
+    my_mapped_task.expand(input=[1, 2, 3])
+
+For a classic operator, pass the policy to ``.partial()``:
+
+.. code-block:: python
+
+    BashOperator.partial(task_id="run", retry_policy=my_policy).expand(
+        bash_command=["echo 1", "echo 2", "echo 3"],
+    )
+
+The policy is set once on the task, in ``@task(...)`` or ``.partial()``; all
+mapped instances share one policy. Per-index variation is not supported on
+``.expand()``, but the policy's ``evaluate()`` method receives the exception,
+``try_number``, and full context, so per-index branching can be done inside the
+policy if needed.
 
 Chaining policies
 ~~~~~~~~~~~~~~~~~

Reply via email to