From d5b8364405bd834e2600bac24701207187aa745b Mon Sep 17 00:00:00 2001 From: Wolfgang Müller Date: Fri, 7 May 2021 13:30:06 +0200 Subject: tables: Indicate that the DateTimeUTC TypeDecorator may be cached The cache_ok flag was added [1] in SQLAlchemy 1.4.14 and emits a warning if not set to either True or False. Since DateTimeUTC should be fine to cache, indicate True here. [1] https://docs.sqlalchemy.org/en/14/core/custom_types.html#sqlalchemy.types.TypeDecorator.cache_ok --- quarg/database/tables.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quarg/database/tables.py b/quarg/database/tables.py index cdb3b68..6e92c14 100644 --- a/quarg/database/tables.py +++ b/quarg/database/tables.py @@ -16,6 +16,8 @@ class DateTimeUTC(TypeDecorator): # pylint: disable=abstract-method impl = TypeEngine + cache_ok = True + def load_dialect_impl(self, dialect): if dialect.name == 'sqlite': return dialect.type_descriptor(Integer) -- cgit v1.2.3-2-gb3c3