From d74d435af77d92c0e231796c7656ad77ca95b6f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 18:47:14 +0000 Subject: [PATCH 1/2] Bump types-python-dateutil from 2.9.0.20251115 to 2.9.0.20260408 Bumps [types-python-dateutil](https://github.com/python/typeshed) from 2.9.0.20251115 to 2.9.0.20260408. - [Commits](https://github.com/python/typeshed/commits) --- updated-dependencies: - dependency-name: types-python-dateutil dependency-version: 2.9.0.20260408 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f831d9f..524211b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,7 +89,7 @@ dev-mypy = [ "frequenz-client-dispatch[cli,dev-mkdocs,dev-noxfile,dev-pytest]", "grpc-stubs == 1.53.0.6", "types-protobuf == 7.34.1.20260408", - "types-python-dateutil == 2.9.0.20251115", + "types-python-dateutil == 2.9.0.20260408", ] dev-noxfile = ["nox == 2026.4.10", "frequenz-repo-config[lib] == 0.17.0"] dev-pylint = [ From 2fba18cd966f58f7f166b451d571cbf2cae95454 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Wed, 6 May 2026 14:49:16 +0200 Subject: [PATCH 2/2] Remove unnecessary cast The new dateutil stubs fixed the wrong type. Signed-off-by: Leandro Lucarella --- src/frequenz/client/dispatch/types.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/frequenz/client/dispatch/types.py b/src/frequenz/client/dispatch/types.py index d06586c..af9a3c2 100644 --- a/src/frequenz/client/dispatch/types.py +++ b/src/frequenz/client/dispatch/types.py @@ -6,7 +6,7 @@ from dataclasses import dataclass from datetime import datetime, timedelta, timezone from enum import Enum -from typing import Any, Self, SupportsInt, TypeAlias, cast, final +from typing import Any, Self, SupportsInt, TypeAlias, final # pylint: enable=no-name-in-module 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: return None # No type information for rrule, so we need to cast - return cast( - datetime | None, - self.recurrence._as_rrule( # pylint: disable=protected-access - self.start_time - ).after(after, inc=True), - ) + return self.recurrence._as_rrule( # pylint: disable=protected-access + self.start_time + ).after(after, inc=True) def _until(self, now: datetime) -> datetime | None: """Calculate the time when the dispatch should end.