mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-10 03:37:51 +02:00
Use uuid6 as the id for checkpoints
- this avoids conflicts if multiple processes creating checkpoints in same thread at same time - uuid6 with a monotically increasing clock_seq is sortable by creation time at ms precision (plus clock_seq for ties, plus 48 bits of randomness for further ties)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import pytest
|
||||
from langchain_core.runnables import RunnableConfig
|
||||
|
||||
from langgraph.checkpoint.base import Checkpoint, CheckpointMetadata
|
||||
from langgraph.channels.base import create_checkpoint
|
||||
from langgraph.checkpoint.base import Checkpoint, CheckpointMetadata, empty_checkpoint
|
||||
from langgraph.checkpoint.sqlite import SqliteSaver, _metadata_predicate, search_where
|
||||
|
||||
|
||||
@@ -18,20 +19,8 @@ class TestSqliteSaver:
|
||||
"configurable": {"thread_id": "thread-2", "thread_ts": "2"}
|
||||
}
|
||||
|
||||
self.chkpnt_1: Checkpoint = {
|
||||
"v": 1,
|
||||
"ts": "1",
|
||||
"channel_values": {},
|
||||
"channel_versions": {},
|
||||
"versions_seen": {},
|
||||
}
|
||||
self.chkpnt_2: Checkpoint = {
|
||||
"v": 2,
|
||||
"ts": "2",
|
||||
"channel_values": {},
|
||||
"channel_versions": {},
|
||||
"versions_seen": {},
|
||||
}
|
||||
self.chkpnt_1: Checkpoint = empty_checkpoint()
|
||||
self.chkpnt_2: Checkpoint = create_checkpoint(self.chkpnt_1, {}, 1)
|
||||
|
||||
self.metadata_1: CheckpointMetadata = {
|
||||
"source": "input",
|
||||
|
||||
Reference in New Issue
Block a user