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/08/23 12:37:02 UTC

[GitHub] [airflow] kaxil commented on a diff in pull request #25845: Update code examples from "classic" operators to taskflow

kaxil commented on code in PR #25845:
URL: https://github.com/apache/airflow/pull/25845#discussion_r952563181


##########
docs/apache-airflow/upgrading-from-1-10/index.rst:
##########
@@ -924,6 +929,23 @@ instead. On top of that, a new dag.callback_exceptions counter metric has
 been added to help better monitor callback exceptions.
 
 
+Migrating to TaskFlow API
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Airflow 2.0 introduced the TaskFlow API to simplify the declaration of Python callable tasks.
+Users are encouraged to replace classic operators with their TaskFlow decorator alternatives.
+For details, see :doc:`/tutorial_taskflow_api`.
+
+============================= ============================================
+Classic Operator              TaskFlow Decorator
+============================= ============================================
+``PythonOperator``            ``@task`` (short for ``@task.python``)
+``PythonVirtualenvOperator``  ``@task.virtualenv``
+``BranchPythonOperator``      ``@task.branch``
+``DockerOperator``            ``@task.docker``
+============================= ============================================

Review Comment:
   We also have ``@task.kubernetes`` now



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