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


##########
docs/apache-airflow/concepts/dags.rst:
##########
@@ -269,11 +269,14 @@ By default, a DAG will only run a Task when all the Tasks 
it depends on are succ
 Branching
 ~~~~~~~~~
 
-You can make use of branching in order to tell the DAG *not* to run all 
dependent tasks, but instead to pick and choose one or more paths to go down. 
This is where the branching Operators come in.
+You can make use of branching in order to tell the DAG *not* to run all 
dependent tasks, but instead to pick and choose one or more paths to go down. 
This is where the ``@task.branch`` decorator come in.
 
-The ``BranchPythonOperator`` is much like the PythonOperator except that it 
expects a ``python_callable`` that returns a task_id (or list of task_ids). The 
task_id returned is followed, and all of the other paths are skipped. It can 
also return None to skip all downstream task.
+The ``@task.branch`` is much like the ``@task`` decorator except that it 
expects a ``python_callable`` that returns a task_id (or list of task_ids). The 
task_id returned is followed, and all of the other paths are skipped. It can 
also return None to skip all downstream task.
 
-The task_id returned by the Python function has to reference a task directly 
downstream from the BranchPythonOperator task.
+.. warning::
+    The ``@task.branch`` decorator is recommended over the classic 
:class:`~airflow.operators.python.BranchPythonOperator`.

Review Comment:
   This note can probably be moved to under the part where we mention 
subclassing `BranchPythonOperator`, and say something like this instead:
   
   > The `@task.branch` decorator is recommended over directly instantiating 
:class:`~airflow.operators.python.BranchPythonOperator` in a DAG.
   ```



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