summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Johnson <johnsomor@gmail.com>2022-07-21 17:41:18 +0000
committerMichael Johnson <johnsomor@gmail.com>2022-07-21 17:51:45 +0000
commit3afd9a02fb49ad51821570e9709351ef756ececa (patch)
tree10c2010fd6af20ebc9c788f3947a2779e7ff99bf
parent3423a3e6568c1755405d4dc31eed1121769eb7a2 (diff)
downloaddesignate-3afd9a02fb49ad51821570e9709351ef756ececa.tar.gz
Enable cache_ok on custom sqlalchemy UUID type
This patch adds the "cache_ok = True" to the custom sqlalchemy UUID type in designate. It resolves the warning: designate/sqlalchemy/base.py:243: SAWarning: TypeDecorator UUID() will not produce a cache key because the ``cache_ok`` attribute is not set to True. This can have significant performance implications including some performance degradations in comparison to prior SQLAlchemy versions. Set this attribute to True if this type object's state is safe to use in a cache key, or False to disable this warning. (Background on this error at: https://sqlalche.me/e/14/cprf) Change-Id: Ic3aca3836b331db495109f6b6672e5c8af1d4028
-rw-r--r--designate/sqlalchemy/types.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/designate/sqlalchemy/types.py b/designate/sqlalchemy/types.py
index b576e8bf..6063454d 100644
--- a/designate/sqlalchemy/types.py
+++ b/designate/sqlalchemy/types.py
@@ -27,6 +27,7 @@ class UUID(TypeDecorator):
Copied verbatim from SQLAlchemy documentation.
"""
+ cache_ok = True
impl = CHAR
def load_dialect_impl(self, dialect):