Basically, input variable client is not a data jso...
# ask-the-community
f
Basically, input variable client is not a data json but a custom class object, therefore is not appropriate to be an input or output in a task is what I figured. How do I initialize a shared object in the workflow script to be used by all the tasks?
e
@Frank Shen, the original error has to do with the fact that Flyte doesn't know how to serialize
FeathrClient
, so as a last resort, we attempt to serialize the object via pickling, but
pickle
fails with that error you pasted (i.e.
TypeError: can't pickle _thread.lock objects
). You have two options: 1. Define a type transformer for the
FeathrClient
type (follow https://docs.flyte.org/projects/cookbook/en/latest/auto/core/extend_flyte/custom_types.html#advanced-custom-types for an example) 2. Define a top-level variable.
f
@Eduardo Apolinario (eapolinario), that makes sense. I will go with the second option. Thank you and have a great weekend!
176 Views