diff --git a/libs/langgraph/langgraph/channels/dynamic_barrier_value.py b/libs/langgraph/langgraph/channels/dynamic_barrier_value.py index ea6ca9815..c2c3c026f 100644 --- a/libs/langgraph/langgraph/channels/dynamic_barrier_value.py +++ b/libs/langgraph/langgraph/channels/dynamic_barrier_value.py @@ -1,4 +1,4 @@ -from collections.abc import Sequence +from collections.abc import Sequence, Set from typing import Any, Generic, NamedTuple, Optional, Union from typing_extensions import Self @@ -9,11 +9,11 @@ from langgraph.errors import EmptyChannelError, InvalidUpdateError class WaitForNames(NamedTuple): - names: set[Any] + names: Set[Any] class DynamicBarrierValue( - Generic[Value], BaseChannel[Value, Union[Value, WaitForNames], set[Value]] + Generic[Value], BaseChannel[Value, Union[Value, WaitForNames], Set[Value]] ): """A channel that switches between two states @@ -26,7 +26,7 @@ class DynamicBarrierValue( __slots__ = ("names", "seen") - names: Optional[set[Value]] + names: Optional[Set[Value]] seen: set[Value] def __init__(self, typ: type[Value]) -> None: @@ -55,11 +55,11 @@ class DynamicBarrierValue( empty.seen = self.seen.copy() return empty - def checkpoint(self) -> tuple[Optional[set[Value]], set[Value]]: + def checkpoint(self) -> tuple[Optional[Set[Value]], set[Value]]: return (self.names, self.seen) def from_checkpoint( - self, checkpoint: tuple[Optional[set[Value]], set[Value]] + self, checkpoint: tuple[Optional[Set[Value]], set[Value]] ) -> Self: empty = self.__class__(self.typ) empty.key = self.key