How to use non-installable modules from DAG code?

后端 未结 1 1635
不知归路
不知归路 2020-12-12 03:33

I have a Git repository which (among other things) holds Airflow DAGs in airflow directory. I have a clone of the repository besides an install directory of Air

相关标签:
1条回答
  • 2020-12-12 03:53

    Re-writing conclusion from discussions here


    Broadly, there are 2 possible ways

    1. Package your code into an Airflow plugin
    2. Make your code discoverable to dag-definition-file(s) parsing processes by updating PYTHONPATH. Here again we have following options

      (a) Update PYTHONPATH on system level using bashrc / equivalent (once-and-for-all) or just export the updated PYTHONPATH for current bash session

      (b) Programmatically update sys.path in the beginning of DAG-definition file

    0 讨论(0)
提交回复
热议问题