diff --git a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/base.py b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/base.py index 121042954..fd868568d 100644 --- a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/base.py +++ b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/base.py @@ -357,9 +357,9 @@ class BasePostgresSaver(BaseCheckpointSaver[str]): a `_ChannelWritesHistory` per requested channel. """ # writes_by_ch_by_cid[channel][cid] = list of (type, blob, task_id, idx) - writes_by_ch_by_cid: dict[ - str, dict[str, list[tuple[str, bytes, str, int]]] - ] = {ch: {} for ch in channels} + writes_by_ch_by_cid: dict[str, dict[str, list[tuple[str, bytes, str, int]]]] = { + ch: {} for ch in channels + } # seed_blob_by_ver[(channel, version)] = (type, blob) seed_blob_by_ver: dict[tuple[str, str], tuple[str, bytes]] = {} diff --git a/libs/checkpoint/langgraph/checkpoint/memory/__init__.py b/libs/checkpoint/langgraph/checkpoint/memory/__init__.py index 11f35b0a5..c74f2f118 100644 --- a/libs/checkpoint/langgraph/checkpoint/memory/__init__.py +++ b/libs/checkpoint/langgraph/checkpoint/memory/__init__.py @@ -189,9 +189,7 @@ class InMemorySaver( ver = versions.get(ch) if ver is None: continue - blob_entry = self.blobs.get( - (thread_id, checkpoint_ns, ch, ver) - ) + blob_entry = self.blobs.get((thread_id, checkpoint_ns, ch, ver)) if blob_entry is None or blob_entry[0] == "empty": continue blob_value = self.serde.loads_typed(blob_entry) diff --git a/libs/checkpoint/tests/test_memory.py b/libs/checkpoint/tests/test_memory.py index 369ca65cd..fccc09705 100644 --- a/libs/checkpoint/tests/test_memory.py +++ b/libs/checkpoint/tests/test_memory.py @@ -482,9 +482,9 @@ class TestBaseFallbackGetChannelWrites: } } - result = saver._get_all_delta_channels_writes_history( - config, ["messages"] - )["messages"] + result = saver._get_all_delta_channels_writes_history(config, ["messages"])[ + "messages" + ] assert result.seed is DELTA_SENTINEL values = [v for _, _, v in result.writes] diff --git a/libs/langgraph/langgraph/pregel/_checkpoint.py b/libs/langgraph/langgraph/pregel/_checkpoint.py index 715b5df1f..951bdfcf9 100644 --- a/libs/langgraph/langgraph/pregel/_checkpoint.py +++ b/libs/langgraph/langgraph/pregel/_checkpoint.py @@ -136,9 +136,7 @@ def channels_from_checkpoint( ] histories: Mapping[str, Any] = {} if delta_channels and saver is not None and config is not None: - histories = saver._get_all_delta_channels_writes_history( - config, delta_channels - ) + histories = saver._get_all_delta_channels_writes_history(config, delta_channels) channels: dict[str, BaseChannel] = {} for k, spec in channel_specs.items():