How to import packages in the DAG folder when using git-sync sidecar? #818
-
When using git-sync sidecar for DAG the repository is dumped into Let's say you have this repository and you want to do # In /opt/airflow/dags/
repo/
dags/
__init__.py
mydag.py
foo/
__init__.py
bar.py This will error due to a few things missing...
The last point is quite undesirable. When I'm in my repository it works as |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You're going to have to add airflow:
extraEnv:
- name: "PYTHONPATH"
value: "/opt/airflow/dags/repo/" |
Beta Was this translation helpful? Give feedback.
You're going to have to add
/opt/airflow/dags/repo/
to Python'ssys.path
. You can use the env varPYTHONPATH
.