Skip to content

Commit

Permalink
style: fix type hint
Browse files Browse the repository at this point in the history
  • Loading branch information
EspenAlbert committed Feb 9, 2024
1 parent 5affd69 commit 6484bfb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model_lib/src/model_lib/pydantic_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def ensure_timezone(value: datetime):
return value.replace(tzinfo=timezone.utc)
return value

utc_datetime = Annotated[datetime, AfterValidator(ensure_timezone)]
utc_datetime: TypeAlias = Annotated[datetime, AfterValidator(ensure_timezone)]
else:

class _utc_datetime(datetime):
Expand All @@ -181,7 +181,7 @@ def ensure_utc(cls, value: datetime):
return value.replace(tzinfo=timezone.utc)
return value

utc_datetime = Union[_utc_datetime, datetime]
utc_datetime: TypeAlias = Union[_utc_datetime, datetime]

if IS_PYDANTIC_V2:
utc_datetime_ms: TypeAlias = Annotated[
Expand Down

0 comments on commit 6484bfb

Please sign in to comment.