Airflow Relative Imports

Viewed 597

I'm trying to import a module from two directories above the /dags directory. My folder structure looks like this:

app
 --> __init__.py
 --> my_module
    --> __init__.py
 --> airflow
    --> dags
        --> my_dag.py
        --> __init__.py

I've tried this, which pylint gives no errors for:

from app import my_module

However this gives the error ImportError: No module named 'app' when running airflow initdb. How do I import my_module in my_dag.py?

0 Answers
Related