I'm trying to use local module inside a dag on MWAA.
The folder structure looks like :
.
├── __init__.py
├── dags
│ ├── __init__.py
│ └── my_dag
│ ├── __init__.py
│ └── dag.py
│ └── utils
│ ├── __init__.py
│ └── file.py
│ └── secrets.py
│ └── date.py
I try to use functions from ./dags/utils/secrets
by importing them like :
from dags.utils.secrets import get_secret
Locally, I've been able to make it works by setting environment variable PYTHONPATH to usr/local/airflow
Is it the best way ? If not how can I make it works on MWAA ?
Thank you,