Could somebody please clarify the expected behavior when using save_main_session
and custom modules imported in __main__
. My DataFlow pipeline imports 2 non-standard modules - one via requirements.txt
and another one via setup_file
. Unless I move the imports into the functions where they get used I keep getting import/pickling errors. Sample error is below. From the documentation, I assumed that setting save_main_session
would help to solve this problem, but it does not (see error below). So I wonder if I missed something or this behavior is by design. The same import works fine when placed into a function.
Error:
File "/usr/lib/python2.7/pickle.py", line 1130, in find_class __import__(module) ImportError: No module named jmespath