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/15 07:36:23 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #22562: Adding sensor decorator

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


##########
docs/apache-airflow/tutorial_taskflow_api.rst:
##########
@@ -266,6 +266,20 @@ Python version to run your function.
 These two options should allow for far greater flexibility for users who wish to keep their workflows more simple
 and Pythonic.
 
+Using the TaskFlow API with Sensor operators
+--------------------------------------------
+You can apply the ``@task.sensor`` decorator to convert a regular Python function to an instance of the
+BaseSensorOperator class. The Python function implements the poke logic and returns an instance of
+the ``PokeReturnValue`` class as the ``poke()`` method in the BaseSensorOperator does. The ``PokeReturnValue`` is
+a new feature in Airflow 2.3 that allows a sensor operator to push an XCom value as described in
+`Community Providers <https://github.com/apache/airflow/blob/main/docs/apache-airflow-providers/howto/create-update-providers.rst>`_ under the section "Having sensors return XOM values".

Review Comment:
   Don’t do this



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