From b99734d1570eb1f931429aa616f6bd80d5f7fa47 Mon Sep 17 00:00:00 2001 From: vbarda Date: Mon, 14 Oct 2024 10:14:41 -0400 Subject: [PATCH] langgraph: support copy without update in Pregel --- libs/langgraph/langgraph/pregel/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/langgraph/langgraph/pregel/__init__.py b/libs/langgraph/langgraph/pregel/__init__.py index 441647355..d842815e6 100644 --- a/libs/langgraph/langgraph/pregel/__init__.py +++ b/libs/langgraph/langgraph/pregel/__init__.py @@ -252,8 +252,8 @@ class Pregel(Runnable[Union[dict[str, Any], Any], Union[dict[str, Any], Any]]): if auto_validate: self.validate() - def copy(self, update: dict[str, Any]) -> Self: - attrs = {**self.__dict__, **update} + def copy(self, update: dict[str, Any] | None = None) -> Self: + attrs = {**self.__dict__, **(update or {})} return self.__class__(**attrs) def with_config(self, config: RunnableConfig | None = None, **kwargs: Any) -> Self: