Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions infrahub_sdk/timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from datetime import datetime, timezone
from typing import Literal, TypedDict

from typing_extensions import NotRequired
from typing_extensions import NotRequired, Self
from whenever import Date, Instant, OffsetDateTime, PlainDateTime, Time, ZonedDateTime

from .exceptions import TimestampFormatError
Expand Down Expand Up @@ -147,7 +147,7 @@ def __ge__(self, other: object) -> bool:
def __hash__(self) -> int:
return hash(self.to_string())

def add_delta(self, hours: int = 0, minutes: int = 0, seconds: int = 0, microseconds: int = 0) -> Timestamp:
def add_delta(self, hours: int = 0, minutes: int = 0, seconds: int = 0, microseconds: int = 0) -> Self:
warnings.warn(
"add_delta() is deprecated. Use add() instead.",
UserWarning,
Expand All @@ -168,7 +168,7 @@ def add(
microseconds: float = 0,
nanoseconds: int = 0,
disambiguate: Literal["compatible"] = "compatible",
) -> Timestamp:
) -> Self:
return self.__class__(
self._obj.add(
years=years,
Expand Down Expand Up @@ -198,7 +198,7 @@ def subtract(
microseconds: float = 0,
nanoseconds: int = 0,
disambiguate: Literal["compatible"] = "compatible",
) -> Timestamp:
) -> Self:
return self.__class__(
self._obj.subtract(
years=years,
Expand Down