I am hitting an issue when trying to unpickle and internal class object inside of a deployed prefect flow. It is raising the following error:
Can't get attribute 'Document' on <module 'prefect.engine' from '/app/.venv/lib/python3.11/site-packages/prefect/engine.py'>
This runs fine in prefect locally but not once deployed with a docker image. I am importing the
Document
class at the top of my file containing the flow. Any ideas why this might be happening?
n
Nate
07/08/2024, 4:13 PM
hi @Nelson Griffiths - this is odd.
it looks like its thinking your document class is in
prefect.engine
?
can you show your import? im wondering if there is some namespace conflict
n
Nelson Griffiths
07/08/2024, 4:14 PM
Basically this:
from my_private_library.tools.namespace import Document
n
Nate
07/08/2024, 5:24 PM
hmm im not sure
Nate
07/08/2024, 5:24 PM
do you have the whole stack trace?
n
Nelson Griffiths
07/08/2024, 5:31 PM
Let me see if I can get that real quick
Nelson Griffiths
07/10/2024, 1:22 PM
Sorry for the late reply. Pickle was a poor choice of tool for this. We just moved to json instead and it works. Not sure what the error is but everything is working without pickle now.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.