Add checkpoint config to checkpoint metadata?

This commit is contained in:
Andrew Nguonly
2024-05-17 19:25:02 -07:00
parent 18addb52aa
commit 09bae3022d
3 changed files with 56 additions and 14 deletions
+8 -4
View File
@@ -760,10 +760,11 @@ class Pregel(
)
)
checkpoint_config = {
**checkpoint_config,
"configurable": {
**checkpoint_config["configurable"],
"thread_ts": checkpoint["id"],
}
},
}
# increment start to 0
start += 1
@@ -885,10 +886,11 @@ class Pregel(
)
)
checkpoint_config = {
**checkpoint_config,
"configurable": {
**checkpoint_config["configurable"],
"thread_ts": checkpoint["id"],
}
},
}
# yield debug checkpoint
if stream_mode == "debug":
@@ -1031,10 +1033,11 @@ class Pregel(
)
)
checkpoint_config = {
**checkpoint_config,
"configurable": {
**checkpoint_config["configurable"],
"thread_ts": checkpoint["id"],
}
},
}
# increment start to 0
start += 1
@@ -1162,10 +1165,11 @@ class Pregel(
)
)
checkpoint_config = {
**checkpoint_config,
"configurable": {
**checkpoint_config["configurable"],
"thread_ts": checkpoint["id"],
}
},
}
# yield debug checkpoint
if stream_mode == "debug":
+24 -4
View File
@@ -4372,10 +4372,15 @@ def test_branch_then(snapshot: SnapshotAssertion) -> None:
"step": 0,
"payload": {
"config": {
"tags": [],
"metadata": {"thread_id": "10"},
"callbacks": None,
"recursion_limit": 25,
"run_id": None,
"configurable": {
"thread_id": "10",
"thread_ts": AnyStr(),
}
},
},
"values": {"my_key": "value", "market": "DE"},
},
@@ -4407,10 +4412,15 @@ def test_branch_then(snapshot: SnapshotAssertion) -> None:
"step": 1,
"payload": {
"config": {
"tags": [],
"metadata": {"thread_id": "10"},
"callbacks": None,
"recursion_limit": 25,
"run_id": None,
"configurable": {
"thread_id": "10",
"thread_ts": AnyStr(),
}
},
},
"values": {"my_key": "value prepared", "market": "DE"},
},
@@ -4442,10 +4452,15 @@ def test_branch_then(snapshot: SnapshotAssertion) -> None:
"step": 2,
"payload": {
"config": {
"tags": [],
"metadata": {"thread_id": "10"},
"callbacks": None,
"recursion_limit": 25,
"run_id": None,
"configurable": {
"thread_id": "10",
"thread_ts": AnyStr(),
}
},
},
"values": {"my_key": "value prepared slow", "market": "DE"},
},
@@ -4477,10 +4492,15 @@ def test_branch_then(snapshot: SnapshotAssertion) -> None:
"step": 3,
"payload": {
"config": {
"tags": [],
"metadata": {"thread_id": "10"},
"callbacks": None,
"recursion_limit": 25,
"run_id": None,
"configurable": {
"thread_id": "10",
"thread_ts": AnyStr(),
}
},
},
"values": {
"my_key": "value prepared slow finished",
+24 -6
View File
@@ -3584,8 +3584,6 @@ async def test_start_branch_then() -> None:
async def test_branch_then() -> None:
pass
class State(TypedDict):
my_key: Annotated[str, operator.add]
market: str
@@ -3629,10 +3627,15 @@ async def test_branch_then() -> None:
"step": 0,
"payload": {
"config": {
"tags": [],
"metadata": {"thread_id": "10"},
"callbacks": None,
"recursion_limit": 25,
"run_id": None,
"configurable": {
"thread_id": "10",
"thread_ts": AnyStr(),
}
},
},
"values": {"my_key": "value", "market": "DE"},
},
@@ -3664,10 +3667,15 @@ async def test_branch_then() -> None:
"step": 1,
"payload": {
"config": {
"tags": [],
"metadata": {"thread_id": "10"},
"callbacks": None,
"recursion_limit": 25,
"run_id": None,
"configurable": {
"thread_id": "10",
"thread_ts": AnyStr(),
}
},
},
"values": {"my_key": "value prepared", "market": "DE"},
},
@@ -3699,10 +3707,15 @@ async def test_branch_then() -> None:
"step": 2,
"payload": {
"config": {
"tags": [],
"metadata": {"thread_id": "10"},
"callbacks": None,
"recursion_limit": 25,
"run_id": None,
"configurable": {
"thread_id": "10",
"thread_ts": AnyStr(),
}
},
},
"values": {"my_key": "value prepared slow", "market": "DE"},
},
@@ -3734,10 +3747,15 @@ async def test_branch_then() -> None:
"step": 3,
"payload": {
"config": {
"tags": [],
"metadata": {"thread_id": "10"},
"callbacks": None,
"recursion_limit": 25,
"run_id": None,
"configurable": {
"thread_id": "10",
"thread_ts": AnyStr(),
}
},
},
"values": {
"my_key": "value prepared slow finished",