Skip to content

Commit

Permalink
fix document about response_check in HttpSensor (#24708)
Browse files Browse the repository at this point in the history
  • Loading branch information
ishiis authored Jun 28, 2022
1 parent 510a6ba commit ccd28cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions airflow/providers/http/sensors/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,18 @@ class HttpSensor(BaseSensorOperator):
The response check can access the template context to the operator:
.. code-block:: python
def response_check(response, task_instance):
# The task_instance is injected, so you can pull data form xcom
# Other context variables such as dag, ds, execution_date are also available.
xcom_data = task_instance.xcom_pull(task_ids='pushing_task')
xcom_data = task_instance.xcom_pull(task_ids="pushing_task")
# In practice you would do something more sensible with this data..
print(xcom_data)
return True
HttpSensor(task_id='my_http_sensor', ..., response_check=response_check)
HttpSensor(task_id="my_http_sensor", ..., response_check=response_check)
.. seealso::
For more information on how to use this operator, take a look at the guide:
Expand Down

0 comments on commit ccd28cb

Please sign in to comment.