How To Use Non-installable Modules From Dag Code?
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 Airflow. airflow direct
Solution 1:
Re-writing conclusion from discussions here
Broadly, there are 2 possible ways
- Package your code into an Airflow plugin
Make your code discoverable to dag-definition-file(s) parsing processes by updating
PYTHONPATH. Here again we have following options(a) Update
PYTHONPATHon system level usingbashrc/ equivalent (once-and-for-all) or justexportthe updatedPYTHONPATHfor current bash session(b) Programmatically update
sys.pathin the beginning of DAG-definition file
Post a Comment for "How To Use Non-installable Modules From Dag Code?"