Good morning all, I couldn't find anything related...
# prefect-community
r
Good morning all, I couldn't find anything related so far and I am sorry if there is already a thread to this but I have updated a flow which is using one of our modules for data processing. The flow file was updated properly but my module remains the same resulting in an AttributeError not finding my new method. Is Prefect caching my "old" module? Do I have to explicitly update it?
e
Good morning! In short: Yes, you need to explicitly upgrade your module version. Serialized prefect flows do not contain modules themselves, they need to be present in the python runtime that your flow is executing in. This is because prefect serializes your flows either with
cloudpickle
, or as a python script. Both of these options store calls to external modules as references.
upvote 1
Another way to think about this: •
flow.storage
is responsible for packaging your flow logic (How are tasks connected, what code do tasks contain?) •
flow.run_config
is responsible for packaging your runtime and dependencies (What modules does my task need?)
💯 1
r
Emre, thank you so much 🙂 One of my colleagues ran into the same problem a while ago. We will try to fix it with your info.
e
np, this is a common issue, it can be hard to gauge what is packaged in a flow file and what isn't. There seems to be a discourse post about it as well, if you need more context.
r
That was very helpful, again thank you 🙂 this has been my first issue with Prefect, other than that: Great product, I really enjoy working with it! Keep it up 🙂
🙌 1