uranusjr commented on code in PR #25711:
URL: https://github.com/apache/airflow/pull/25711#discussion_r961464490
##########
docs/apache-airflow/concepts/dags.rst:
##########
@@ -413,7 +411,13 @@ You can also combine this with the
:ref:`concepts:depends-on-past` functionality
)
run_this_first = EmptyOperator(task_id="run_this_first", dag=dag)
- branching = BranchPythonOperator(task_id="branching", dag=dag,
python_callable=lambda: "branch_a")
+
+ @task.branch(task_id="branching")
+ def branching():
+ return "branch_a"
+
+
+ branching = branching()
Review Comment:
```suggestion
@task.branch(task_id="branching")
def do_branching():
return "branch_a"
branching = do_branching()
```
Using the same name for the function and task should be discouraged
--
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]