Use separate environ and sys.path between dags

后端 未结 1 1010
被撕碎了的回忆
被撕碎了的回忆 2020-12-22 04:55

* TLDR: This question originally based on problem that was later determined to be due to the updated title of this question. Skip to \"Update 2\" for most r

1条回答
  •  囚心锁ツ
    2020-12-22 05:37

    For bringing in specific modules from other paths, I use the solution here to import other python modules by specifying their absolute file path.

    For running various python scripts as airflow tasks using different python interpreters, I do something like...

    do_stuff_a = BashOperator(
            task_id='my_task_a',
            bash_command='/path/to/virtualenv_a/bin/python /path/to/script_a.py'),
            execution_timeout=timedelta(minutes=30),
            dag=dag)
    

    as done in similar question here

    0 讨论(0)
提交回复
热议问题