https://prefect.io logo
Title
a

Adam

08/05/2020, 7:49 PM
Hopefully my last question for the day, I’m having some trouble building the docker image for my flow when one of my tasks uses calls another function (non-task) in my file. It fails the health check because of
cloudpickle_deserialization_check
If I stop calling that function it works again. Am I missing something? Can I not call other methods from within a task?
j

josh

08/05/2020, 7:57 PM
Hi @Adam can you post a snippet of what this flow / the method it’s calling looks like? If the other function exists within your file it shouldn’t be raising an error. If it exists outside that file then it will need to be importable on the
PYTHONPATH
in the image
a

Adam

08/05/2020, 8:10 PM
Got it fixed 🙂 Can’t remember what I did though haha
On a related note, do you by any chance have a code snippet on adding additional files to the PYTHONPATH? Something like they mentioned here: https://github.com/PrefectHQ/prefect/issues/2797
j

josh

08/05/2020, 8:14 PM
One way you could do it is setting
env_vars
dict with things like:
env_vars = {
  "PYTHONPATH": "${PYTHONPATH}:/path"
}
a

Adam

08/05/2020, 8:16 PM
Thanks, and how does the
files
property look like? I see it’s expecting a
Dict
but have no idea what to put in it
j

josh

08/05/2020, 8:20 PM
Ah we should update that documentation. Files is a dict something like:
{
  "local/src": "/destination"
}
a

Adam

08/05/2020, 8:30 PM
Thanks @josh!