Add distinct source

This commit is contained in:
Nuno Campos
2024-11-15 17:04:40 -08:00
parent 66b9a7dee7
commit 36e49eb190
2 changed files with 4 additions and 3 deletions
@@ -39,12 +39,13 @@ PendingWrite = Tuple[str, str, Any]
class CheckpointMetadata(TypedDict, total=False):
"""Metadata associated with a checkpoint."""
source: Literal["input", "loop", "update"]
source: Literal["input", "loop", "update", "fork"]
"""The source of the checkpoint.
- "input": The checkpoint was created from an input to invoke/stream/batch.
- "loop": The checkpoint was created from inside the pregel loop.
- "update": The checkpoint was created from a manual state update.
- "fork": The checkpoint was created as a copy of another checkpoint.
"""
step: int
"""The step number of the checkpoint.
+2 -2
View File
@@ -946,7 +946,7 @@ class Pregel(PregelProtocol):
create_checkpoint(checkpoint, None, step),
{
**checkpoint_metadata,
"source": "update",
"source": "fork",
"step": step + 1,
"writes": {},
"parents": saved.metadata.get("parents", {}) if saved else {},
@@ -965,7 +965,7 @@ class Pregel(PregelProtocol):
next_checkpoint,
{
**checkpoint_metadata,
"source": "update",
"source": "fork",
"step": step + 1,
"writes": {},
"parents": saved.metadata.get("parents", {}) if saved else {},