Skip to content

Commit 4ba7990

Browse files
authored
Bump types-python-dateutil from 2.9.0.20250516 to 2.9.0.20250708 (#193)
2 parents 5b19025 + f6489a7 commit 4ba7990

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ dev-mypy = [
8888
"frequenz-client-dispatch[cli,dev-mkdocs,dev-noxfile,dev-pytest]",
8989
"grpc-stubs == 1.53.0.6",
9090
"types-protobuf == 6.30.2.20250703",
91-
"types-python-dateutil == 2.9.0.20250516",
91+
"types-python-dateutil == 2.9.0.20250708",
9292
]
9393
dev-noxfile = ["nox == 2025.5.1", "frequenz-repo-config[lib] == 0.13.5"]
9494
dev-pylint = [

src/frequenz/client/dispatch/recurrence.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,11 @@ def _as_rrule(self, start_time: datetime) -> rrule.rrule:
197197
The rrule object.
198198
199199
Raises:
200-
ValueError: If the interval is 0.
200+
ValueError: If the interval is 0 or the frequency is UNSPECIFIED.
201201
"""
202+
if self.frequency == Frequency.UNSPECIFIED:
203+
raise ValueError("Frequency must be specified")
204+
202205
if self.interval == 0:
203206
raise ValueError("Interval must be greater than 0")
204207

@@ -208,7 +211,10 @@ def _as_rrule(self, start_time: datetime) -> rrule.rrule:
208211
until = end.until
209212

210213
rrule_obj = rrule.rrule(
211-
freq=_RRULE_FREQ_MAP[self.frequency],
214+
# Mypy expects a Literal for the `freq` argument, but it can't infer
215+
# that the values from the `_RRULE_FREQ_MAP` dictionary are of the
216+
# correct type.
217+
freq=_RRULE_FREQ_MAP[self.frequency], # type: ignore[arg-type]
212218
dtstart=start_time,
213219
count=count,
214220
until=until,

0 commit comments

Comments
 (0)