diff --git a/libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py b/libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py index ff5a91f5d..4bd0839c2 100644 --- a/libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py +++ b/libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py @@ -5,6 +5,7 @@ import json import pathlib import re from collections import deque +from collections.abc import Sequence from datetime import date, datetime, time, timedelta, timezone from enum import Enum from inspect import isclass @@ -16,7 +17,7 @@ from ipaddress import ( IPv6Interface, IPv6Network, ) -from typing import Any, Callable, Optional, Sequence, Union, cast +from typing import Any, Callable, Optional, Union, cast from uuid import UUID import msgpack # type: ignore[import-untyped] @@ -502,15 +503,5 @@ def _msgpack_ext_hook(code: int, data: bytes) -> Any: return -ENC_POOL: deque[msgpack.Packer] = deque(maxlen=32) - - def _msgpack_enc(data: Any) -> bytes: - try: - enc = ENC_POOL.popleft() - except IndexError: - enc = msgpack.Packer(default=_msgpack_default) - try: - return enc.pack(data) - finally: - ENC_POOL.append(enc) + return msgpack.packb(data, default=_msgpack_default) diff --git a/libs/checkpoint/pyproject.toml b/libs/checkpoint/pyproject.toml index 2f137faad..9610d8fc5 100644 --- a/libs/checkpoint/pyproject.toml +++ b/libs/checkpoint/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langgraph-checkpoint" -version = "2.0.15" +version = "2.0.16" description = "Library with base interfaces for LangGraph checkpoint savers." authors = [] license = "MIT"