Skip to content

Commit 3afd9a0

Browse files
committed
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
1 parent 3423a3e commit 3afd9a0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

designate/sqlalchemy/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class UUID(TypeDecorator):
2727
2828
Copied verbatim from SQLAlchemy documentation.
2929
"""
30+
cache_ok = True
3031
impl = CHAR
3132

3233
def load_dialect_impl(self, dialect):

0 commit comments

Comments
 (0)