Skip to content

Commit

Permalink
Use type var default
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Sep 19, 2024
1 parent 333c5f5 commit c793a9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libs/checkpoint/langgraph/checkpoint/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
Optional,
Tuple,
TypedDict,
TypeVar,
Union,
)

from langchain_core.runnables import ConfigurableFieldSpec, RunnableConfig
from typing_extensions import TypeVar

from langgraph.checkpoint.base.id import uuid6
from langgraph.checkpoint.serde.base import SerializerProtocol, maybe_add_typed_methods
Expand All @@ -28,7 +28,7 @@
SendProtocol,
)

V = TypeVar("V", int, float, str)
V = TypeVar("V", int, float, str, default=int)
PendingWrite = Tuple[str, str, Any]


Expand Down Expand Up @@ -424,7 +424,7 @@ def get_next_version(self, current: Optional[V], channel: ChannelProtocol) -> V:
if isinstance(current, str):
raise NotImplementedError
elif current is None:
return 1 # type: ignore[return-value]
return 1
else:
return current + 1

Expand Down

0 comments on commit c793a9e

Please sign in to comment.