From 4cdb38d337eb01b017f6ee2f5c96f858d0a31e07 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Tue, 23 Jul 2024 14:59:16 -0700 Subject: [PATCH] Fix null pending writes (#1106) --- libs/langgraph/langgraph/pregel/loop.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/langgraph/langgraph/pregel/loop.py b/libs/langgraph/langgraph/pregel/loop.py index f9c00c62a..ae2ba2edf 100644 --- a/libs/langgraph/langgraph/pregel/loop.py +++ b/libs/langgraph/langgraph/pregel/loop.py @@ -99,7 +99,7 @@ class PregelLoop: checkpoint: Checkpoint checkpoint_config: RunnableConfig checkpoint_metadata: CheckpointMetadata - checkpoint_pending_writes: Optional[List[PendingWrite]] + checkpoint_pending_writes: List[PendingWrite] step: int status: Literal[ @@ -406,7 +406,7 @@ class SyncPregelLoop(PregelLoop, ContextManager): } self.checkpoint = copy_checkpoint(saved.checkpoint) self.checkpoint_metadata = saved.metadata - self.checkpoint_pending_writes = saved.pending_writes + self.checkpoint_pending_writes = saved.pending_writes or [] self.submit = self.stack.enter_context(BackgroundExecutor(self.config)) self.channels = self.stack.enter_context( @@ -484,7 +484,7 @@ class AsyncPregelLoop(PregelLoop, AsyncContextManager): } self.checkpoint = copy_checkpoint(saved.checkpoint) self.checkpoint_metadata = saved.metadata - self.checkpoint_pending_writes = saved.pending_writes + self.checkpoint_pending_writes = saved.pending_writes or [] self.submit = await self.stack.enter_async_context(AsyncBackgroundExecutor()) self.channels = await self.stack.enter_async_context(