Toggle Menu
Prev Up Next

# `langchain_postgres.checkpoint`.PickleCheckpointSerializer

class langchain_postgres.checkpoint.PickleCheckpointSerializer

  Use the pickle module to serialize and deserialize objects.

  This serializer uses the pickle module to serialize and deserialize objects.

  While pickling can serialize a wide range of Python objects, it may fail de-serializable objects upon updates of the Python version or the python environment (e.g., the object’s class definition changes in LangGraph).

  Security Warning: The pickle module can deserialize malicious payloads,

    only use this serializer with trusted data; e.g., data that you have serialized yourself and can guarantee the integrity of.

  Methods

  `__init__`() |
  `dumps`(obj) | Serialize an object to bytes.
  `loads`(data) | Deserialize an object from bytes.

  __init__()
  dumps(obj: Checkpoint) → bytes

    Serialize an object to bytes.

    Parameters

      obj (Checkpoint) –

    Return type

      bytes

  loads(data: bytes) → Checkpoint

    Deserialize an object from bytes.

    Parameters

      data (bytes) –

    Return type

      Checkpoint