We actually found the issue here. It happens when a task has an input / output that includes a generic
TypeVar
. These get added to the task
Interface
which gets passed down the stack and handed to
to_python_value
expected_python_type
on a custom
TypeTransformer
. At serialization time, the actual type is known in place of the
TypeVar
but during deserialization, our deserializer was getting confused because it was trying to deserialize to the
TypeVar
instead of the concrete type since that's what comes in to
to_python_value
. The workaround we found is to explicitly serialize the concrete type information in place of the
TypeVar
alongside the serialized object and then ignore the type information passed into
to_python_value
and instead use the serialized type information.