Python script scheduling in airflow
You should probably use the PythonOperator to call your function. If you want to define the function somewhere else, you can simply import it from a module as long as it’s accessible in your PYTHONPATH. from airflow import DAG from airflow.operators.python_operator import PythonOperator from my_script import my_python_function dag = DAG(‘tutorial’, default_args=default_args) PythonOperator(dag=dag, task_id=’my_task_powered_by_python’, provide_context=False, python_callable=my_python_function, … Read more