From 7f4822931ebf67e907bf93ba5939e833ac7f3b54 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Fri, 14 Feb 2025 18:24:48 -0800 Subject: [PATCH] Update tests --- .../langgraph/checkpoint/postgres/__init__.py | 19 +- .../langgraph/checkpoint/postgres/aio.py | 19 +- .../langgraph/checkpoint/postgres/shallow.py | 37 +-- .../langgraph/checkpoint/sqlite/__init__.py | 15 +- .../langgraph/checkpoint/sqlite/aio.py | 15 +- .../langgraph/checkpoint/base/__init__.py | 23 ++ .../langgraph/checkpoint/memory/__init__.py | 19 +- libs/langgraph/tests/test_large_cases.py | 280 ------------------ .../langgraph/tests/test_large_cases_async.py | 198 ------------- libs/langgraph/tests/test_prebuilt.py | 5 - libs/langgraph/tests/test_pregel.py | 11 - libs/langgraph/tests/test_pregel_async.py | 59 ---- 12 files changed, 36 insertions(+), 664 deletions(-) diff --git a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/__init__.py b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/__init__.py index 87241259c..1c3426603 100644 --- a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/__init__.py +++ b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/__init__.py @@ -16,6 +16,7 @@ from langgraph.checkpoint.base import ( CheckpointMetadata, CheckpointTuple, get_checkpoint_id, + get_checkpoint_metadata, ) from langgraph.checkpoint.postgres import _internal from langgraph.checkpoint.postgres.base import BasePostgresSaver @@ -317,23 +318,7 @@ class PostgresSaver(BasePostgresSaver): checkpoint["id"], checkpoint_id, Jsonb(self._dump_checkpoint(copy)), - self._dump_metadata( - { - **{ - k: v - for k, v in config["configurable"].items() - if not k.startswith("__") - and isinstance(v, (str, int, bool, float)) - }, - **{ - k: v - for k, v in config.get("metadata", {}).items() - if not k.startswith("__") - and isinstance(v, (str, int, bool, float)) - }, - **metadata, - } - ), + self._dump_metadata(get_checkpoint_metadata(config, metadata)), ), ) return next_config diff --git a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py index abfeb8a60..a19b7bfc1 100644 --- a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py +++ b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/aio.py @@ -16,6 +16,7 @@ from langgraph.checkpoint.base import ( CheckpointMetadata, CheckpointTuple, get_checkpoint_id, + get_checkpoint_metadata, ) from langgraph.checkpoint.postgres import _ainternal from langgraph.checkpoint.postgres.base import BasePostgresSaver @@ -275,23 +276,7 @@ class AsyncPostgresSaver(BasePostgresSaver): checkpoint["id"], checkpoint_id, Jsonb(self._dump_checkpoint(copy)), - self._dump_metadata( - { - **{ - k: v - for k, v in config["configurable"].items() - if not k.startswith("__") - and isinstance(v, (str, int, bool, float)) - }, - **{ - k: v - for k, v in config.get("metadata", {}).items() - if not k.startswith("__") - and isinstance(v, (str, int, bool, float)) - }, - **metadata, - } - ), + self._dump_metadata(get_checkpoint_metadata(config, metadata)), ), ) return next_config diff --git a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/shallow.py b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/shallow.py index 53c092e68..90e140b2c 100644 --- a/libs/checkpoint-postgres/langgraph/checkpoint/postgres/shallow.py +++ b/libs/checkpoint-postgres/langgraph/checkpoint/postgres/shallow.py @@ -24,6 +24,7 @@ from langgraph.checkpoint.base import ( Checkpoint, CheckpointMetadata, CheckpointTuple, + get_checkpoint_metadata, ) from langgraph.checkpoint.postgres import _ainternal, _internal from langgraph.checkpoint.postgres.base import BasePostgresSaver @@ -423,23 +424,7 @@ class ShallowPostgresSaver(BasePostgresSaver): thread_id, checkpoint_ns, Jsonb(self._dump_checkpoint(copy)), - self._dump_metadata( - { - **{ - k: v - for k, v in config["configurable"].items() - if not k.startswith("__") - and isinstance(v, (str, int, bool, float)) - }, - **{ - k: v - for k, v in config.get("metadata", {}).items() - if not k.startswith("__") - and isinstance(v, (str, int, bool, float)) - }, - **metadata, - } - ), + self._dump_metadata(get_checkpoint_metadata(config, metadata)), ), ) return next_config @@ -758,23 +743,7 @@ class AsyncShallowPostgresSaver(BasePostgresSaver): thread_id, checkpoint_ns, Jsonb(self._dump_checkpoint(copy)), - self._dump_metadata( - { - **{ - k: v - for k, v in config["configurable"].items() - if not k.startswith("__") - and isinstance(v, (str, int, bool, float)) - }, - **{ - k: v - for k, v in config.get("metadata", {}).items() - if not k.startswith("__") - and isinstance(v, (str, int, bool, float)) - }, - **metadata, - } - ), + self._dump_metadata(get_checkpoint_metadata(config, metadata)), ), ) return next_config diff --git a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py index 6dfa876d5..71a098f75 100644 --- a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py +++ b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/__init__.py @@ -15,6 +15,7 @@ from langgraph.checkpoint.base import ( CheckpointTuple, SerializerProtocol, get_checkpoint_id, + get_checkpoint_metadata, ) from langgraph.checkpoint.serde.jsonplus import JsonPlusSerializer from langgraph.checkpoint.serde.types import ChannelProtocol @@ -398,19 +399,7 @@ class SqliteSaver(BaseCheckpointSaver[str]): checkpoint_ns = config["configurable"]["checkpoint_ns"] type_, serialized_checkpoint = self.serde.dumps_typed(checkpoint) serialized_metadata = self.jsonplus_serde.dumps( - { - **{ - k: v - for k, v in config["configurable"].items() - if not k.startswith("__") and isinstance(v, (str, int, bool, float)) - }, - **{ - k: v - for k, v in config.get("metadata", {}).items() - if not k.startswith("__") and isinstance(v, (str, int, bool, float)) - }, - **metadata, - } + get_checkpoint_metadata(config, metadata) ) with self.cursor() as cur: cur.execute( diff --git a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py index e4862c130..befa6cfbe 100644 --- a/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py +++ b/libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py @@ -16,6 +16,7 @@ from langgraph.checkpoint.base import ( CheckpointTuple, SerializerProtocol, get_checkpoint_id, + get_checkpoint_metadata, ) from langgraph.checkpoint.serde.jsonplus import JsonPlusSerializer from langgraph.checkpoint.serde.types import ChannelProtocol @@ -464,19 +465,7 @@ class AsyncSqliteSaver(BaseCheckpointSaver[str]): checkpoint_ns = config["configurable"]["checkpoint_ns"] type_, serialized_checkpoint = self.serde.dumps_typed(checkpoint) serialized_metadata = self.jsonplus_serde.dumps( - { - **{ - k: v - for k, v in config["configurable"].items() - if not k.startswith("__") and isinstance(v, (str, int, bool, float)) - }, - **{ - k: v - for k, v in config.get("metadata", {}).items() - if not k.startswith("__") and isinstance(v, (str, int, bool, float)) - }, - **metadata, - } + get_checkpoint_metadata(config, metadata) ) async with ( self.lock, diff --git a/libs/checkpoint/langgraph/checkpoint/base/__init__.py b/libs/checkpoint/langgraph/checkpoint/base/__init__.py index 96b1d3cf7..52f94f424 100644 --- a/libs/checkpoint/langgraph/checkpoint/base/__init__.py +++ b/libs/checkpoint/langgraph/checkpoint/base/__init__.py @@ -446,6 +446,23 @@ def get_checkpoint_id(config: RunnableConfig) -> Optional[str]: ) +def get_checkpoint_metadata( + config: RunnableConfig, metadata: CheckpointMetadata +) -> CheckpointMetadata: + """Get checkpoint metadata in a backwards-compatible manner.""" + metadata = metadata.copy() + for obj in (config.get("metadata"), config.get("configurable")): + if not obj: + continue + for key in obj: + if key in metadata or key in EXCLUDED_METADATA_KEYS or key.startswith("__"): + continue + v = obj[key] + if isinstance(v, (str, int, bool, float)): + metadata[key] = v + return metadata + + """ Mapping from error type to error index. Regular writes just map to their index in the list of writes being saved. @@ -454,3 +471,9 @@ conflicting with regular writes. Each Checkpointer implementation should use this mapping in put_writes. """ WRITES_IDX_MAP = {ERROR: -1, SCHEDULED: -2, INTERRUPT: -3, RESUME: -4} + +EXCLUDED_METADATA_KEYS = { + "checkpoint_id", + "checkpoint_ns", + "checkpoint_map", +} diff --git a/libs/checkpoint/langgraph/checkpoint/memory/__init__.py b/libs/checkpoint/langgraph/checkpoint/memory/__init__.py index e7b81d324..6eeb8867b 100644 --- a/libs/checkpoint/langgraph/checkpoint/memory/__init__.py +++ b/libs/checkpoint/langgraph/checkpoint/memory/__init__.py @@ -20,6 +20,7 @@ from langgraph.checkpoint.base import ( CheckpointTuple, SerializerProtocol, get_checkpoint_id, + get_checkpoint_metadata, ) from langgraph.checkpoint.serde.types import TASKS, ChannelProtocol @@ -356,23 +357,7 @@ class InMemorySaver( { checkpoint["id"]: ( self.serde.dumps_typed(c), - self.serde.dumps_typed( - { - **{ - k: v - for k, v in config["configurable"].items() - if not k.startswith("__") - and isinstance(v, (str, int, bool, float)) - }, - **{ - k: v - for k, v in config.get("metadata", {}).items() - if not k.startswith("__") - and isinstance(v, (str, int, bool, float)) - }, - **metadata, - } - ), + self.serde.dumps_typed(get_checkpoint_metadata(config, metadata)), config["configurable"].get("checkpoint_id"), # parent ) } diff --git a/libs/langgraph/tests/test_large_cases.py b/libs/langgraph/tests/test_large_cases.py index d0fda301d..f562720b8 100644 --- a/libs/langgraph/tests/test_large_cases.py +++ b/libs/langgraph/tests/test_large_cases.py @@ -135,8 +135,6 @@ def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 6, @@ -158,8 +156,6 @@ def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 5, @@ -181,8 +177,6 @@ def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "input", "step": 4, @@ -204,8 +198,6 @@ def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -227,8 +219,6 @@ def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "input", "step": 2, @@ -250,8 +240,6 @@ def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -273,8 +261,6 @@ def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -296,7 +282,6 @@ def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_ns": "", "parents": {}, "source": "input", "step": -1, @@ -364,8 +349,6 @@ def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 5, @@ -387,8 +370,6 @@ def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 4, @@ -410,8 +391,6 @@ def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -433,8 +412,6 @@ def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 2, @@ -456,8 +433,6 @@ def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -479,8 +454,6 @@ def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -502,7 +475,6 @@ def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_ns": "", "parents": {}, "source": "input", "step": -1, @@ -787,8 +759,6 @@ def test_conditional_graph( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -853,8 +823,6 @@ def test_conditional_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 1, @@ -977,8 +945,6 @@ def test_conditional_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 4, @@ -1052,8 +1018,6 @@ def test_conditional_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -1112,8 +1076,6 @@ def test_conditional_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 1, @@ -1236,8 +1198,6 @@ def test_conditional_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 4, @@ -1311,8 +1271,6 @@ def test_conditional_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -1712,8 +1670,6 @@ def test_conditional_state_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -1767,8 +1723,6 @@ def test_conditional_state_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 2, @@ -1857,8 +1811,6 @@ def test_conditional_state_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 5, @@ -1920,8 +1872,6 @@ def test_conditional_state_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -1974,8 +1924,6 @@ def test_conditional_state_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 2, @@ -2062,8 +2010,6 @@ def test_conditional_state_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 5, @@ -2114,8 +2060,6 @@ def test_conditional_state_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -2158,8 +2102,6 @@ def test_conditional_state_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -2226,8 +2168,6 @@ def test_conditional_state_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 2, @@ -2306,8 +2246,6 @@ def test_conditional_state_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -2374,8 +2312,6 @@ def test_conditional_state_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 2, @@ -3114,8 +3050,6 @@ def test_state_graph_packets( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -3180,8 +3114,6 @@ def test_state_graph_packets( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 2, @@ -3295,8 +3227,6 @@ def test_state_graph_packets( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 4, @@ -3374,8 +3304,6 @@ def test_state_graph_packets( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 5, @@ -3455,8 +3383,6 @@ def test_state_graph_packets( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -3515,8 +3441,6 @@ def test_state_graph_packets( config=app_w_interrupt.checkpointer.get_tuple(config).config, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 2, @@ -3630,8 +3554,6 @@ def test_state_graph_packets( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 4, @@ -3707,8 +3629,6 @@ def test_state_graph_packets( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 5, @@ -3998,8 +3918,6 @@ def test_message_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -4051,8 +3969,6 @@ def test_message_graph( config=next_config, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 2, @@ -4146,8 +4062,6 @@ def test_message_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 4, @@ -4211,8 +4125,6 @@ def test_message_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 5, @@ -4276,8 +4188,6 @@ def test_message_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -4335,8 +4245,6 @@ def test_message_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 2, @@ -4430,8 +4338,6 @@ def test_message_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 4, @@ -4496,8 +4402,6 @@ def test_message_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 5, @@ -4550,8 +4454,6 @@ def test_message_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 6, @@ -4839,8 +4741,6 @@ def test_root_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -4892,8 +4792,6 @@ def test_root_graph( config=next_config, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 2, @@ -4988,8 +4886,6 @@ def test_root_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 4, @@ -5054,8 +4950,6 @@ def test_root_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 5, @@ -5119,8 +5013,6 @@ def test_root_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -5178,8 +5070,6 @@ def test_root_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 2, @@ -5274,8 +5164,6 @@ def test_root_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 4, @@ -5339,8 +5227,6 @@ def test_root_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 5, @@ -5393,8 +5279,6 @@ def test_root_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 6, @@ -5478,8 +5362,6 @@ def test_root_graph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 6, @@ -5840,8 +5722,6 @@ def test_dynamic_interrupt( if "shallow" not in checkpointer_name: assert [c.metadata for c in tool_two.checkpointer.list(thread1)] == [ { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -5849,7 +5729,6 @@ def test_dynamic_interrupt( "thread_id": "1", }, { - "checkpoint_ns": "", "parents": {}, "source": "input", "step": -1, @@ -5884,8 +5763,6 @@ def test_dynamic_interrupt( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -5914,8 +5791,6 @@ def test_dynamic_interrupt( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 1, @@ -6024,8 +5899,6 @@ def test_copy_checkpoint( if "shallow" not in checkpointer_name: assert [c.metadata for c in tool_two.checkpointer.list(thread1)] == [ { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -6033,7 +5906,6 @@ def test_copy_checkpoint( "thread_id": "1", }, { - "checkpoint_ns": "", "parents": {}, "source": "input", "step": -1, @@ -6074,8 +5946,6 @@ def test_copy_checkpoint( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -6123,8 +5993,6 @@ def test_copy_checkpoint( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "fork", "step": 1, @@ -6233,8 +6101,6 @@ def test_dynamic_interrupt_subgraph( ) ] == [ { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -6242,7 +6108,6 @@ def test_dynamic_interrupt_subgraph( "thread_id": "1", }, { - "checkpoint_ns": "", "parents": {}, "source": "input", "step": -1, @@ -6283,8 +6148,6 @@ def test_dynamic_interrupt_subgraph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -6317,8 +6180,6 @@ def test_dynamic_interrupt_subgraph( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 1, @@ -6407,8 +6268,6 @@ def test_start_branch_then( if "shallow" not in checkpointer_name: assert [c.metadata for c in tool_two.checkpointer.list(thread1)] == [ { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -6417,7 +6276,6 @@ def test_start_branch_then( "thread_id": "1", }, { - "checkpoint_ns": "", "parents": {}, "source": "input", "step": -1, @@ -6440,8 +6298,6 @@ def test_start_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -6473,8 +6329,6 @@ def test_start_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -6508,8 +6362,6 @@ def test_start_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -6541,8 +6393,6 @@ def test_start_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -6576,8 +6426,6 @@ def test_start_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -6606,8 +6454,6 @@ def test_start_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 1, @@ -6639,8 +6485,6 @@ def test_start_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 2, @@ -7015,8 +6859,6 @@ def test_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -7047,8 +6889,6 @@ def test_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -7081,8 +6921,6 @@ def test_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -7113,8 +6951,6 @@ def test_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -7155,8 +6991,6 @@ def test_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 2, @@ -7188,8 +7022,6 @@ def test_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 3, @@ -7230,8 +7062,6 @@ def test_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -7262,8 +7092,6 @@ def test_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -7296,8 +7124,6 @@ def test_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -7328,8 +7154,6 @@ def test_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -7360,7 +7184,6 @@ def test_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 0, @@ -7388,8 +7211,6 @@ def test_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -7420,8 +7241,6 @@ def test_branch_then( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -7558,8 +7377,6 @@ def test_send_dedupe_on_resume( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": {"3": ["3"]}, "thread_id": "1", @@ -7596,8 +7413,6 @@ def test_send_dedupe_on_resume( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": {"2": ["2|3"], "3": ["3"], "flaky": ["flaky|4"]}, "thread_id": "1", @@ -7641,8 +7456,6 @@ def test_send_dedupe_on_resume( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": { "2": [ @@ -7708,8 +7521,6 @@ def test_send_dedupe_on_resume( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": {"1": ["1"]}, "thread_id": "1", @@ -7765,8 +7576,6 @@ def test_send_dedupe_on_resume( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": None, "thread_id": "1", @@ -7804,7 +7613,6 @@ def test_send_dedupe_on_resume( } }, metadata={ - "checkpoint_ns": "", "source": "input", "writes": {"__start__": ["0"]}, "thread_id": "1", @@ -7908,8 +7716,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"outer_1": {"my_key": "hi my value"}}, @@ -7961,8 +7767,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "parents": { "": AnyStr(), }, @@ -8009,8 +7813,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"outer_1": {"my_key": "hi my value"}}, @@ -8057,8 +7859,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"outer_1": {"my_key": "hi my value"}}, @@ -8097,8 +7897,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": None, @@ -8133,7 +7931,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_ns": "", "parents": {}, "source": "input", "writes": {"__start__": {"my_key": "my value"}}, @@ -8167,8 +7964,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "loop", "writes": { "inner_1": { @@ -8217,8 +8012,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "loop", "writes": None, "step": 0, @@ -8268,8 +8061,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_id": None, - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "input", "writes": {"__start__": {"my_key": "hi my value"}}, "step": -1, @@ -8315,8 +8106,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": { @@ -8353,8 +8142,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": { @@ -8395,8 +8182,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"inner": {"my_key": "hi my value here and there"}}, @@ -8434,8 +8219,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"outer_1": {"my_key": "hi my value"}}, @@ -8470,8 +8253,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": None, @@ -8506,7 +8287,6 @@ def test_nested_graph_state( } }, metadata={ - "checkpoint_ns": "", "parents": {}, "source": "input", "writes": {"__start__": {"my_key": "my value"}}, @@ -8617,8 +8397,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"parent_1": {"my_key": "hi my value"}}, @@ -8665,8 +8443,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {"": AnyStr()}, "source": "loop", "writes": None, @@ -8713,8 +8489,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr(), AnyStr("child:"): AnyStr()}), "parents": AnyDict( { "": AnyStr(), @@ -8794,10 +8568,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict( - {"": AnyStr(), AnyStr("child:"): AnyStr()} - ), "parents": AnyDict( { "": AnyStr(), @@ -8856,8 +8626,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "parents": {"": AnyStr()}, "source": "loop", "writes": None, @@ -8897,8 +8665,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"parent_1": {"my_key": "hi my value"}}, @@ -8944,8 +8710,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": { @@ -8987,8 +8751,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": { @@ -9017,8 +8779,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": {"child": {"my_key": "hi my value here and there"}}, "step": 2, @@ -9067,8 +8827,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"parent_1": {"my_key": "hi my value"}}, @@ -9095,8 +8853,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": None, "step": 0, @@ -9131,7 +8887,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_ns": "", "source": "input", "writes": {"__start__": {"my_key": "my value"}}, "step": -1, @@ -9167,8 +8922,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "loop", "writes": {"child_1": {"my_key": "hi my value here and there"}}, "step": 1, @@ -9208,8 +8961,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "loop", "writes": None, "step": 0, @@ -9262,8 +9013,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": None, - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "input", "writes": {"__start__": {"my_key": "hi my value"}}, "step": -1, @@ -9309,8 +9058,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr(), AnyStr("child1:"): AnyStr()}), "source": "loop", "writes": {"grandchild_2": {"my_key": "hi my value here and there"}}, "step": 2, @@ -9366,8 +9113,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr(), AnyStr("child1:"): AnyStr()}), "source": "loop", "writes": {"grandchild_1": {"my_key": "hi my value here"}}, "step": 1, @@ -9430,8 +9175,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr(), AnyStr("child1:"): AnyStr()}), "source": "loop", "writes": None, "step": 0, @@ -9494,8 +9237,6 @@ def test_doubly_nested_graph_state( } }, metadata={ - "checkpoint_id": None, - "checkpoint_map": AnyDict({"": AnyStr(), AnyStr("child1:"): AnyStr()}), "source": "input", "writes": {"__start__": {"my_key": "hi my value"}}, "step": -1, @@ -9761,8 +9502,6 @@ def test_send_react_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "step": 1, "source": "loop", "writes": { @@ -9834,8 +9573,6 @@ def test_send_react_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "step": 2, "source": "update", "writes": { @@ -9923,8 +9660,6 @@ def test_send_react_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "step": 1, "source": "loop", "writes": { @@ -10019,8 +9754,6 @@ def test_send_react_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "step": 2, "source": "update", "writes": { @@ -10237,8 +9970,6 @@ def test_send_react_interrupt_control( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "step": 1, "source": "loop", "writes": { @@ -10310,8 +10041,6 @@ def test_send_react_interrupt_control( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "step": 2, "source": "update", "writes": { @@ -10503,8 +10232,6 @@ def test_weather_subgraph( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": {"router_node": {"route": "weather"}}, "step": 1, @@ -10597,8 +10324,6 @@ def test_weather_subgraph( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": {"router_node": {"route": "weather"}}, "step": 1, @@ -10644,8 +10369,6 @@ def test_weather_subgraph( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "loop", "writes": {"model_node": {"city": "San Francisco"}}, "step": 1, @@ -10709,8 +10432,6 @@ def test_weather_subgraph( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": {"router_node": {"route": "weather"}}, "step": 1, @@ -10757,7 +10478,6 @@ def test_weather_subgraph( } }, metadata={ - "checkpoint_map": AnyDict({"": AnyStr()}), "step": 2, "source": "update", "writes": { diff --git a/libs/langgraph/tests/test_large_cases_async.py b/libs/langgraph/tests/test_large_cases_async.py index 28e76832c..250cbfe72 100644 --- a/libs/langgraph/tests/test_large_cases_async.py +++ b/libs/langgraph/tests/test_large_cases_async.py @@ -133,8 +133,6 @@ async def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 6, @@ -158,8 +156,6 @@ async def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 5, @@ -183,8 +179,6 @@ async def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "input", "step": 4, @@ -206,8 +200,6 @@ async def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -231,8 +223,6 @@ async def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "input", "step": 2, @@ -254,8 +244,6 @@ async def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -279,8 +267,6 @@ async def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -304,7 +290,6 @@ async def test_invoke_two_processes_in_out_interrupt( } }, metadata={ - "checkpoint_ns": "", "parents": {}, "source": "input", "step": -1, @@ -381,8 +366,6 @@ async def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 5, @@ -404,8 +387,6 @@ async def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 4, @@ -427,8 +408,6 @@ async def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -450,8 +429,6 @@ async def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 2, @@ -473,8 +450,6 @@ async def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -496,8 +471,6 @@ async def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -521,7 +494,6 @@ async def test_fork_always_re_runs_nodes( } }, metadata={ - "checkpoint_ns": "", "parents": {}, "source": "input", "step": -1, @@ -862,8 +834,6 @@ async def test_conditional_graph(checkpointer_name: str) -> None: await app_w_interrupt.checkpointer.aget_tuple(config) ).checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -924,8 +894,6 @@ async def test_conditional_graph(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 1, @@ -1050,8 +1018,6 @@ async def test_conditional_graph(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 4, @@ -1134,8 +1100,6 @@ async def test_conditional_graph(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -1196,8 +1160,6 @@ async def test_conditional_graph(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 1, @@ -1322,8 +1284,6 @@ async def test_conditional_graph(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 4, @@ -1406,8 +1366,6 @@ async def test_conditional_graph(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -1840,8 +1798,6 @@ async def test_conditional_graph_state( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -1897,8 +1853,6 @@ async def test_conditional_graph_state( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 2, @@ -1989,8 +1943,6 @@ async def test_conditional_graph_state( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 5, @@ -2058,8 +2010,6 @@ async def test_conditional_graph_state( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -2114,8 +2064,6 @@ async def test_conditional_graph_state( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 2, @@ -2204,8 +2152,6 @@ async def test_conditional_graph_state( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 5, @@ -2822,8 +2768,6 @@ async def test_state_graph_packets(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -2883,8 +2827,6 @@ async def test_state_graph_packets(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 2, @@ -2994,8 +2936,6 @@ async def test_state_graph_packets(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 4, @@ -3065,8 +3005,6 @@ async def test_state_graph_packets(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 5, @@ -3141,8 +3079,6 @@ async def test_state_graph_packets(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -3204,8 +3140,6 @@ async def test_state_graph_packets(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 2, @@ -3315,8 +3249,6 @@ async def test_state_graph_packets(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 4, @@ -3386,8 +3318,6 @@ async def test_state_graph_packets(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 5, @@ -3645,8 +3575,6 @@ async def test_message_graph(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -3701,8 +3629,6 @@ async def test_message_graph(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 2, @@ -3793,8 +3719,6 @@ async def test_message_graph(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 4, @@ -3855,8 +3779,6 @@ async def test_message_graph(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 5, @@ -4165,8 +4087,6 @@ async def test_start_branch_then(checkpointer_name: str) -> None: if "shallow" not in checkpointer_name: assert [c.metadata async for c in tool_two.checkpointer.alist(thread1)] == [ { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -4175,7 +4095,6 @@ async def test_start_branch_then(checkpointer_name: str) -> None: "thread_id": "1", }, { - "checkpoint_ns": "", "parents": {}, "source": "input", "step": -1, @@ -4198,8 +4117,6 @@ async def test_start_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -4233,8 +4150,6 @@ async def test_start_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -4270,8 +4185,6 @@ async def test_start_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -4305,8 +4218,6 @@ async def test_start_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -4342,8 +4253,6 @@ async def test_start_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -4374,8 +4283,6 @@ async def test_start_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 1, @@ -4409,8 +4316,6 @@ async def test_start_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 2, @@ -4951,8 +4856,6 @@ async def test_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -4985,8 +4888,6 @@ async def test_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -5021,8 +4922,6 @@ async def test_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -5055,8 +4954,6 @@ async def test_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -5099,8 +4996,6 @@ async def test_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -5133,8 +5028,6 @@ async def test_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -5169,8 +5062,6 @@ async def test_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -5203,8 +5094,6 @@ async def test_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -5233,7 +5122,6 @@ async def test_branch_then(checkpointer_name: str) -> None: config=uconfig, created_at=AnyStr(), metadata={ - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 0, @@ -5261,8 +5149,6 @@ async def test_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -5289,8 +5175,6 @@ async def test_branch_then(checkpointer_name: str) -> None: }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 3, @@ -5382,8 +5266,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"outer_1": {"my_key": "hi my value"}}, @@ -5435,8 +5317,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "parents": { "": AnyStr(), }, @@ -5483,8 +5363,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"outer_1": {"my_key": "hi my value"}}, @@ -5531,8 +5409,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"outer_1": {"my_key": "hi my value"}}, @@ -5571,8 +5447,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": None, @@ -5607,7 +5481,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_ns": "", "parents": {}, "source": "input", "writes": {"__start__": {"my_key": "my value"}}, @@ -5643,8 +5516,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "loop", "writes": { "inner_1": { @@ -5693,8 +5564,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "loop", "writes": None, "step": 0, @@ -5744,8 +5613,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": None, - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "input", "writes": {"__start__": {"my_key": "hi my value"}}, "step": -1, @@ -5791,8 +5658,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": { @@ -5829,8 +5694,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": { @@ -5873,8 +5736,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"inner": {"my_key": "hi my value here and there"}}, @@ -5915,8 +5776,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"outer_1": {"my_key": "hi my value"}}, @@ -5951,8 +5810,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": None, @@ -5987,7 +5844,6 @@ async def test_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_ns": "", "parents": {}, "source": "input", "writes": {"__start__": {"my_key": "my value"}}, @@ -6097,8 +5953,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"parent_1": {"my_key": "hi my value"}}, @@ -6145,8 +5999,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {"": AnyStr()}, "source": "loop", "writes": None, @@ -6193,8 +6045,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr(), AnyStr("child:"): AnyStr()}), "parents": AnyDict( { "": AnyStr(), @@ -6274,10 +6124,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict( - {"": AnyStr(), AnyStr("child:"): AnyStr()} - ), "parents": AnyDict( { "": AnyStr(), @@ -6340,8 +6186,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "parents": {"": AnyStr()}, "source": "loop", "writes": None, @@ -6381,8 +6225,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"parent_1": {"my_key": "hi my value"}}, @@ -6431,8 +6273,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": { @@ -6478,8 +6318,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": { @@ -6510,8 +6348,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"child": {"my_key": "hi my value here and there"}}, @@ -6556,8 +6392,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"parent_1": {"my_key": "hi my value"}}, @@ -6615,7 +6449,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_ns": "", "parents": {}, "source": "input", "writes": {"my_key": "my value"}, @@ -6651,8 +6484,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "loop", "writes": {"child_1": {"my_key": "hi my value here and there"}}, "step": 1, @@ -6692,8 +6523,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "loop", "writes": None, "step": 0, @@ -6746,8 +6575,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": None, - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "input", "writes": {"__start__": {"my_key": "hi my value"}}, "step": -1, @@ -6795,10 +6622,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict( - {"": AnyStr(), AnyStr("child:"): AnyStr()} - ), "source": "loop", "writes": { "grandchild_2": {"my_key": "hi my value here and there"} @@ -6856,10 +6679,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict( - {"": AnyStr(), AnyStr("child:"): AnyStr()} - ), "source": "loop", "writes": {"grandchild_1": {"my_key": "hi my value here"}}, "step": 1, @@ -6922,10 +6741,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict( - {"": AnyStr(), AnyStr("child:"): AnyStr()} - ), "source": "loop", "writes": None, "step": 0, @@ -6988,10 +6803,6 @@ async def test_doubly_nested_graph_state(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": None, - "checkpoint_map": AnyDict( - {"": AnyStr(), AnyStr("child:"): AnyStr()} - ), "source": "input", "writes": {"__start__": {"my_key": "hi my value"}}, "step": -1, @@ -7270,8 +7081,6 @@ async def test_weather_subgraph( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": {"router_node": {"route": "weather"}}, "step": 1, @@ -7368,8 +7177,6 @@ async def test_weather_subgraph( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": {"router_node": {"route": "weather"}}, "step": 1, @@ -7415,8 +7222,6 @@ async def test_weather_subgraph( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_map": AnyDict({"": AnyStr()}), "source": "loop", "writes": {"model_node": {"city": "San Francisco"}}, "step": 1, @@ -7480,8 +7285,6 @@ async def test_weather_subgraph( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": {"router_node": {"route": "weather"}}, "step": 1, @@ -7528,7 +7331,6 @@ async def test_weather_subgraph( } }, metadata={ - "checkpoint_map": AnyDict({"": AnyStr()}), "step": 2, "source": "update", "writes": { diff --git a/libs/langgraph/tests/test_prebuilt.py b/libs/langgraph/tests/test_prebuilt.py index 9d662ce14..b0a19d530 100644 --- a/libs/langgraph/tests/test_prebuilt.py +++ b/libs/langgraph/tests/test_prebuilt.py @@ -63,7 +63,6 @@ from langgraph.store.base import BaseStore from langgraph.store.memory import InMemoryStore from langgraph.types import Command, Interrupt, interrupt from langgraph.utils.config import get_stream_writer -from tests.any_str import AnyStr from tests.conftest import ( ALL_CHECKPOINTERS_ASYNC, ALL_CHECKPOINTERS_SYNC, @@ -183,8 +182,6 @@ def test_no_prompt( "agent": "agent", } assert saved.metadata == { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"agent": {"messages": [AIMessage(content="hi?", id="0")]}}, @@ -217,8 +214,6 @@ async def test_no_prompt_async(checkpointer_name: str) -> None: "agent": "agent", } assert saved.metadata == { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"agent": {"messages": [AIMessage(content="hi?", id="0")]}}, diff --git a/libs/langgraph/tests/test_pregel.py b/libs/langgraph/tests/test_pregel.py index d8a3b088a..7e15db62f 100644 --- a/libs/langgraph/tests/test_pregel.py +++ b/libs/langgraph/tests/test_pregel.py @@ -1112,8 +1112,6 @@ def test_pending_writes_resume( PregelTask(AnyStr(), "two", (PULL, "two"), 'ConnectionError("I\'m not good")'), ) assert state.metadata == { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -1212,8 +1210,6 @@ def test_pending_writes_resume( "channel_values": {"one": "one", "two": "two", "value": 6}, }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "step": 1, "source": "loop", @@ -1264,8 +1260,6 @@ def test_pending_writes_resume( }, }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "step": 0, "source": "loop", @@ -1307,7 +1301,6 @@ def test_pending_writes_resume( "channel_values": {"__start__": {"value": 1}}, }, metadata={ - "checkpoint_ns": "", "parents": {}, "step": -1, "source": "input", @@ -2398,8 +2391,6 @@ def test_in_one_fan_out_state_graph_waiting_edge( }, created_at=AnyStr(), metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 4, @@ -4835,8 +4826,6 @@ def test_parent_command(request: pytest.FixtureRequest, checkpointer_name: str) } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": { "alice": { diff --git a/libs/langgraph/tests/test_pregel_async.py b/libs/langgraph/tests/test_pregel_async.py index dc91fc2e9..f369a7aa7 100644 --- a/libs/langgraph/tests/test_pregel_async.py +++ b/libs/langgraph/tests/test_pregel_async.py @@ -606,8 +606,6 @@ async def test_dynamic_interrupt(checkpointer_name: str) -> None: if "shallow" not in checkpointer_name: assert [c.metadata async for c in tool_two.checkpointer.alist(thread1)] == [ { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -615,7 +613,6 @@ async def test_dynamic_interrupt(checkpointer_name: str) -> None: "thread_id": "1", }, { - "checkpoint_ns": "", "parents": {}, "source": "input", "step": -1, @@ -644,8 +641,6 @@ async def test_dynamic_interrupt(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -672,8 +667,6 @@ async def test_dynamic_interrupt(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 1, @@ -798,8 +791,6 @@ async def test_dynamic_interrupt_subgraph(checkpointer_name: str) -> None: c.metadata async for c in tool_two.checkpointer.alist(thread1root) ] == [ { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -807,7 +798,6 @@ async def test_dynamic_interrupt_subgraph(checkpointer_name: str) -> None: "thread_id": "1", }, { - "checkpoint_ns": "", "parents": {}, "source": "input", "step": -1, @@ -842,8 +832,6 @@ async def test_dynamic_interrupt_subgraph(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -870,8 +858,6 @@ async def test_dynamic_interrupt_subgraph(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "update", "step": 1, @@ -990,8 +976,6 @@ async def test_copy_checkpoint(checkpointer_name: str) -> None: if "shallow" not in checkpointer_name: assert [c.metadata async for c in tool_two.checkpointer.alist(thread1)] == [ { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -999,7 +983,6 @@ async def test_copy_checkpoint(checkpointer_name: str) -> None: "thread_id": "1", }, { - "checkpoint_ns": "", "parents": {}, "source": "input", "step": -1, @@ -1038,8 +1021,6 @@ async def test_copy_checkpoint(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -1083,8 +1064,6 @@ async def test_copy_checkpoint(checkpointer_name: str) -> None: config=tup.config, created_at=tup.checkpoint["ts"], metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "fork", "step": 1, @@ -1251,8 +1230,6 @@ async def test_cancel_graph_astream(checkpointer_name: str) -> None: assert state.values == {"value": 3} # 1 + 2 assert state.next == ("aparallelwhile",) assert state.metadata == { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -1330,8 +1307,6 @@ async def test_cancel_graph_astream_events_v2(checkpointer_name: Optional[str]) assert state.values == {"value": 2} assert state.next == ("awhile",) assert state.metadata == { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 1, @@ -2032,8 +2007,6 @@ async def test_pending_writes_resume( ), ) assert state.metadata == { - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "step": 0, @@ -2132,8 +2105,6 @@ async def test_pending_writes_resume( "channel_values": {"one": "one", "two": "two", "value": 6}, }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "step": 1, "source": "loop", @@ -2186,8 +2157,6 @@ async def test_pending_writes_resume( }, }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "step": 0, "source": "loop", @@ -2231,7 +2200,6 @@ async def test_pending_writes_resume( "channel_values": {"__start__": {"value": 1}}, }, metadata={ - "checkpoint_ns": "", "parents": {}, "step": -1, "source": "input", @@ -2810,8 +2778,6 @@ async def test_send_dedupe_on_resume(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": {"3": ["3"]}, "thread_id": "1", @@ -2848,8 +2814,6 @@ async def test_send_dedupe_on_resume(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": {"2": ["2|3"], "3": ["3"], "flaky": ["flaky|4"]}, "thread_id": "1", @@ -2893,8 +2857,6 @@ async def test_send_dedupe_on_resume(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": { "2": [ @@ -2960,8 +2922,6 @@ async def test_send_dedupe_on_resume(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": {"1": ["1"]}, "thread_id": "1", @@ -3017,8 +2977,6 @@ async def test_send_dedupe_on_resume(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": None, "thread_id": "1", @@ -3056,7 +3014,6 @@ async def test_send_dedupe_on_resume(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_ns": "", "source": "input", "writes": {"__start__": ["0"]}, "thread_id": "1", @@ -3229,8 +3186,6 @@ async def test_send_react_interrupt(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "step": 1, "source": "loop", "writes": { @@ -3302,8 +3257,6 @@ async def test_send_react_interrupt(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "step": 2, "source": "update", "writes": { @@ -3391,8 +3344,6 @@ async def test_send_react_interrupt(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "step": 1, "source": "loop", "writes": { @@ -3485,8 +3436,6 @@ async def test_send_react_interrupt(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "step": 2, "source": "update", "writes": { @@ -3702,8 +3651,6 @@ async def test_send_react_interrupt_control( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "step": 1, "source": "loop", "writes": { @@ -3775,8 +3722,6 @@ async def test_send_react_interrupt_control( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "step": 2, "source": "update", "writes": { @@ -4726,8 +4671,6 @@ async def test_in_one_fan_out_state_graph_waiting_edge_custom_state_class( } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "parents": {}, "source": "loop", "writes": {"qa": {"answer": "doc1,doc2,doc3,doc4"}}, @@ -6202,8 +6145,6 @@ async def test_parent_command(checkpointer_name: str) -> None: } }, metadata={ - "checkpoint_id": AnyStr(), - "checkpoint_ns": "", "source": "loop", "writes": { "alice": {