I have some some python functions that are mainly there to build tasks in DAG. Is it possible to have these functions in a separate module and import them per dag file?
dag/ dag1/ dag1.py util/ utilA.py utilB.py
Then I want to be able to execute these simple python methods from
dag1.py by using regular python syntax
#dag1.py import util.utilA utilA.function1()
I’ve considered few options:
- operators/hooks: I don’t feel like these util functions should be built as operators/hooks since these are simple python functions.
- adding python module/package: if i understood it correctly, it affects all the dags. i want util module to be available to dag1.py only