Skip to content

Commit

Permalink
Update DAG fsens
Browse files Browse the repository at this point in the history
  • Loading branch information
romanoa77 committed Apr 13, 2024
1 parent b4f150d commit 1c1f8d8
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions dags_airflow_ale_httpsensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ def check_response_itm(response):

return flag

def check_response_usr(response):
js = response.json()
output=js[0]


LoggingMixin().log.info("Member of the list is %s",type(output))

return True

checkNItems = HttpSensor(task_id="check",
http_conn_id="fakeAPIPlaceh",
Expand All @@ -55,9 +60,22 @@ def check_response_itm(response):

)


checkUser = HttpSensor(task_id="checkUser",
http_conn_id="fakeAPIPlaceh",
endpoint="users",
response_check=lambda response: check_response_usr(response),
poke_interval=10,
timeout=100,

)




create_metrics = DummyOperator(task_id="create_metrics", dag=dag)

checkNItems>>create_metrics
checkNItems>>checkUser>>create_metrics



0 comments on commit 1c1f8d8

Please sign in to comment.