Skip to content

Tag: airflow

Airflow PythonOperator inside PythonOperator

How can I run a PythonOperator inside another one PythonOperator? The idea is: to call “main” function as a PythonOperator and then run a few other PythonOperators inside and scheduler them The code is: Answer I think you are expecting that Airflow will create these operators/tasks in the UI but t…

Airflow ExternalTaskSensor don’t fail when External Task fails

I was trying to use the ExternalTaskSensor in Airflow 1.10.11 to manage the coordinate some dags. I have develop this code to test the functionality: The idea is that one dag triggers another one with a TriggerDagRunOperator. This sets the execution_date to the same value in both dags. This works perfectly wh…

AIRFLOW – Setting relationships from a list of operators

I have a list of operators that were appended to a list in a for loop. I would like to set a relationship for my DAG where each task is set downstream in the order of the list. For example Thank you Answer There’s a helper function created for that, will be much more performant than the accepted answer …

Airflow HttpSensor using a default host

I’m trying to poll some endpoint to wait until the Last-Modified header shows the endpoint has been updated in the last five minutes (the default poke interval for the HttpSensor). In the Airflow logs, I see the following: As the logs show, the hostname it’s using is: Using connection to: id: http…