python - Airflow no module named for directory in airflow_home directory -


i'm working virtualenv. i'm trying use packages inside dag folders. current state of airflow_home directory is:

airflow_home/airflow.cfg airflow_home/airflow.db airflow_home/dags/__init__.py  airflow_home/dags/hello_world.py airflow_home/dags/support/inner.py airflow_home/dags/support/__init__.py  

hello_world.py has code:

from datetime import datetime airflow import dag airflow.operators.dummy_operator import dummyoperator airflow.operators.python_operator import pythonoperator dags.support import inner   def print_hello():     return 'hello world'  dag = dag('hello_world', description='simple tutorial dag',           schedule_interval='0 12 * * *', start_date=datetime(2017, 8, 20), catchup=false)  dummy_operator = dummyoperator(task_id='dummy_task', retries=3, dag=dag)  hello_operator = pythonoperator(task_id='hello_task', python_callable=print_hello, dag=dag)  hello_from_inner_operator = pythonoperator(task_id='hello_from_inner', python_callable=inner.hello_from_inner, dag=dag)  dummy_operator >> hello_operator hello_operator >> hello_from_inner_operator 

if manually run script, runs. start airflow scheduler,

broken dag: no module named 'dags' 

error appears. i'm doing wrong, way solve ?

using from support import inner instead.

the path $airflow_home/dags added sys.path when airflow starts. search modules under dags directory.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -