Serialise object using the class-based registry
typ = typename(type(x))
if typ in class_serializers:
dumps, loads, has_context = class_serializers[typ]
if has_context:
header, frames = dumps(x, context=context)
else:
header, frames = dumps(x)
After Change
Serialise object using the class-based registry
type_name = typename(type(x))
try:
dumps = dask_serialize.dispatch(type(x))
except TypeError:
raise NotImplementedError(type_name)
if has_keyword(dumps, "context"):
header, frames = dumps(x, context=context)