Airflow Relative Importing Outside /dag Directory

前端 未结 3 1277
故里飘歌
故里飘歌 2021-02-09 02:12

I haven\'t been able to move common code outside of the dag directory that airflow uses. I\'ve looked in the airflow source and found imp.load_source.

Is it possible to

3条回答
  •  你的背包
    2021-02-09 03:16

    Add your airflow home path to PYTHONPATH

    export AIRFLOW_HOME=/usr/local/airflow
    export PYTHONPATH="${PYTHONPATH}:${AIRFLOW_HOME}"
    

    Dockerfile

    ENV AIRFLOW_HOME=/usr/local/airflow
    ENV PYTHONPATH "${PYTHONPATH}:${AIRFLOW_HOME}"
    

提交回复
热议问题