Haaaaaaaaa I think I found why.
I get all the function dependencies with
pycg
, then try to import them and get their source with
inspect.getsource
to compute a hash. But when instanciated by flytekit, my code is not able to import the task. (e.g: if my task
my_task
is located in the
my_workflow.py
file, the code will try
import <http://my_workflow.my|my_workflow.my>_task
, get the source and hash it, but somehow, inside the flytekit import system it doesn't work anymore. As a fallback, my code was taking the source of the whole file (i.e.
import my_workflow
), that's the workflow version was indeed included in the cache key of every task.
The solution I found is to call this "import and hash" function as a subprocess, outside of any flytekit interference.