Skip to content

Commit f6489a7

Browse files
committed
Ignore mypy error about rrule frequency type
Mypy expects a Literal for the `freq` argument of `rrule.rrule`, but it can't infer that the values from the `_RRULE_FREQ_MAP` dictionary are of the correct type. We add a `# type: ignore[arg-type]` comment to suppress the error. Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent fa34e2a commit f6489a7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/frequenz/client/dispatch/recurrence.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ def _as_rrule(self, start_time: datetime) -> rrule.rrule:
211211
until = end.until
212212

213213
rrule_obj = rrule.rrule(
214-
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]
215218
dtstart=start_time,
216219
count=count,
217220
until=until,

0 commit comments

Comments
 (0)