pyarrow.SerializationContext

class pyarrow.SerializationContext

Bases: pyarrow.lib._Weakrefable

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(*args, **kwargs)

Initialize self.

clone(self)

Return copy of this SerializationContext.

deserialize(self, what)

Call pyarrow.deserialize and pass this SerializationContext.

deserialize_components(self, what)

Call pyarrow.deserialize_components and pass this SerializationContext.

register_type(self, type_, type_id[, …])

EXPERIMENTAL: Add type to the list of types we can serialize.

serialize(self, obj)

Call pyarrow.serialize and pass this SerializationContext.

serialize_to(self, value, sink)

Call pyarrow.serialize_to and pass this SerializationContext.

set_pickle(self, serializer, deserializer)

Set the serializer and deserializer to use for objects that are to be pickled.

clone(self)

Return copy of this SerializationContext.

Returns

clone (SerializationContext)

deserialize(self, what)

Call pyarrow.deserialize and pass this SerializationContext.

deserialize_components(self, what)

Call pyarrow.deserialize_components and pass this SerializationContext.

register_type(self, type_, type_id, pickle=False, custom_serializer=None, custom_deserializer=None)

EXPERIMENTAL: Add type to the list of types we can serialize.

Parameters
  • type_ (type) – The type that we can serialize.

  • type_id (string) – A string used to identify the type.

  • pickle (bool) – True if the serialization should be done with pickle. False if it should be done efficiently with Arrow.

  • custom_serializer (callable) – This argument is optional, but can be provided to serialize objects of the class in a particular way.

  • custom_deserializer (callable) – This argument is optional, but can be provided to deserialize objects of the class in a particular way.

serialize(self, obj)

Call pyarrow.serialize and pass this SerializationContext.

serialize_to(self, value, sink)

Call pyarrow.serialize_to and pass this SerializationContext.

set_pickle(self, serializer, deserializer)

Set the serializer and deserializer to use for objects that are to be pickled.

Parameters
  • serializer (callable) – The serializer to use (e.g., pickle.dumps or cloudpickle.dumps).

  • deserializer (callable) – The deserializer to use (e.g., pickle.dumps or cloudpickle.dumps).