Skip to content

Commit 2fba18c

Browse files
committed
Remove unnecessary cast
The new dateutil stubs fixed the wrong type. Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
1 parent d74d435 commit 2fba18c

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/frequenz/client/dispatch/types.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from dataclasses import dataclass
77
from datetime import datetime, timedelta, timezone
88
from enum import Enum
9-
from typing import Any, Self, SupportsInt, TypeAlias, cast, final
9+
from typing import Any, Self, SupportsInt, TypeAlias, final
1010

1111
# pylint: enable=no-name-in-module
1212
from frequenz.api.common.v1alpha8.microgrid.electrical_components.electrical_components_pb2 import (
@@ -540,12 +540,9 @@ def next_run_after(self, after: datetime) -> datetime | None:
540540
return None
541541

542542
# No type information for rrule, so we need to cast
543-
return cast(
544-
datetime | None,
545-
self.recurrence._as_rrule( # pylint: disable=protected-access
546-
self.start_time
547-
).after(after, inc=True),
548-
)
543+
return self.recurrence._as_rrule( # pylint: disable=protected-access
544+
self.start_time
545+
).after(after, inc=True)
549546

550547
def _until(self, now: datetime) -> datetime | None:
551548
"""Calculate the time when the dispatch should end.

0 commit comments

Comments
 (0)