diff --git a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/base.py b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/base.py index 5f1c010ef..b0a0ff0f1 100644 --- a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/base.py +++ b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/base.py @@ -291,13 +291,18 @@ class BasePostgresSaver(BaseCheckpointSaver[str]): # Step-based snapshot: collect this ancestor's # pending_writes first (they encode the NEXT step's # transition, not subsumed by the snapshot blob). - for type_tag, write_blob, task_id, _idx in writes_by_cid.get( - cid, [] - ): + for ( + type_tag, + write_blob, + task_id, + _idx, + ) in writes_by_cid.get(cid, []): val = self.serde.loads_typed((type_tag, write_blob)) collected.append((task_id, channel, val)) collected.reverse() - return _ChannelWritesHistory(seed=blob_value, writes=collected) + return _ChannelWritesHistory( + seed=blob_value, writes=collected + ) # Pre-delta blob: subsumes this ancestor's writes. collected.reverse() return _ChannelWritesHistory(seed=blob_value, writes=collected) diff --git a/libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py b/libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py index d23633526..7001a5e5f 100644 --- a/libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py +++ b/libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py @@ -33,7 +33,11 @@ from langchain_core.load.load import Reviver from langgraph.checkpoint.serde import _msgpack as _lg_msgpack from langgraph.checkpoint.serde.base import SerializerProtocol from langgraph.checkpoint.serde.event_hooks import emit_serde_event -from langgraph.checkpoint.serde.types import DELTA_SENTINEL, SendProtocol, _DeltaSnapshot +from langgraph.checkpoint.serde.types import ( + DELTA_SENTINEL, + SendProtocol, + _DeltaSnapshot, +) from langgraph.store.base import Item if TYPE_CHECKING: