-
I would like to use the PythonOperator with a function that needs to be imported from an external module, but I want to avoid having to install this module on the webserver/scheduler. I have not yet found a clean way to do this. For example, the following sample DAG is valid only if
A workaround is to create a custom operator that dynamically imports that module and use that operator instead of the Python one, but there must be a better and more straightforward way to do this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
How about using this as callable? def my_function(*args, **kwargs):
from some_module import some_function
return some_function(*args, **kwargs) You still have to have the |
Beta Was this translation helpful? Give feedback.
How about using this as callable?
You still have to have the
some_module
installed on worker but it should not be necessary on scheduler and worker.