Hopefully my last question for the day, I’m having...
# prefect-community
a
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
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
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
One way you could do it is setting
env_vars
dict with things like:
Copy code
env_vars = {
  "PYTHONPATH": "${PYTHONPATH}:/path"
}
a
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
Ah we should update that documentation. Files is a dict something like:
Copy code
{
  "local/src": "/destination"
}
a
Thanks @josh!