From 37d216f9e26961c6e0c4a2211aba49f7620e04ed Mon Sep 17 00:00:00 2001 From: Deimos Date: Tue, 8 Oct 2019 17:30:24 -0600 Subject: [PATCH] Add type annotations for RecurrenceRule methods --- tildes/tildes/lib/database.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tildes/tildes/lib/database.py b/tildes/tildes/lib/database.py index 91efef4..92dbad3 100644 --- a/tildes/tildes/lib/database.py +++ b/tildes/tildes/lib/database.py @@ -6,7 +6,7 @@ import enum from typing import Any, Callable, List, Optional -from dateutil.rrule import rrulestr +from dateutil.rrule import rrule, rrulestr from pyramid.paster import bootstrap from sqlalchemy import cast, func from sqlalchemy.dialects.postgresql import ARRAY @@ -157,14 +157,14 @@ class RecurrenceRule(TypeDecorator): impl = Text - def process_bind_param(self, value, dialect): # type: ignore + def process_bind_param(self, value: rrule, dialect: Dialect) -> str: """Convert the rrule value to a string to store it.""" if value is None: return value return rrule_to_str(value) - def process_result_value(self, value, dialect): # type: ignore + def process_result_value(self, value: str, dialect: Dialect) -> rrule: """Convert the stored string to an rrule.""" if value is None: return value