Skip to content

Commit

Permalink
lib: Fix incorrect default for Command.update (#2809)
Browse files Browse the repository at this point in the history
- this should not default to empty tuple, it should default to None
  • Loading branch information
nfcampos authored Dec 18, 2024
2 parents 8b70da6 + 39281c8 commit 5ad9cfa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libs/langgraph/langgraph/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class Command(Generic[N], ToolOutputMixin):
"""

graph: Optional[str] = None
update: Any = ()
update: Optional[Any] = None
resume: Optional[Union[Any, dict[str, Any]]] = None
goto: Union[Send, Sequence[Union[Send, str]], str] = ()

Expand All @@ -292,8 +292,10 @@ def _update_as_tuples(self) -> Sequence[tuple[str, Any]]:
for t in self.update
):
return self.update
else:
elif self.update is not None:
return [("__root__", self.update)]
else:
return []

PARENT: ClassVar[Literal["__parent__"]] = "__parent__"

Expand Down

0 comments on commit 5ad9cfa

Please sign in to comment.