https://flyte.org logo
#ask-the-community
Title
# ask-the-community
f

Frank Shen

10/21/2022, 9:59 PM
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

Eduardo Apolinario (eapolinario)

10/21/2022, 10:29 PM
@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

Frank Shen

10/21/2022, 11:22 PM
@Eduardo Apolinario (eapolinario), that makes sense. I will go with the second option. Thank you and have a great weekend!
14 Views