The ``cache_ok`` attribute for SQL Alchemy TypeDecorator will emit a
warning when its value is set to the default value ``None``. When this
value is set to True, SQL Alchemy will cache SQL query and reuse it
later when the same query is called again, and vice versa.
This patch simply sets ``cache_ok`` to TypeDecorator classes according
to whether it can be used as a cache key or not [1].
Reviewed: https:/ /review. opendev. org/c/openstack /tacker/ +/830146 /opendev. org/openstack/ tacker/ commit/ 75778a2d98e1440 f56f23787980621 33f57b5568
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 75778a2d98e1440 f56f23787980621 33f57b5568
Author: Hiromu Asahina <email address hidden>
Date: Mon Feb 21 11:03:33 2022 +0000
Suppress Warnings for SQL Alchemy
The ``cache_ok`` attribute for SQL Alchemy TypeDecorator will emit a
warning when its value is set to the default value ``None``. When this
value is set to True, SQL Alchemy will cache SQL query and reuse it
later when the same query is called again, and vice versa.
This patch simply sets ``cache_ok`` to TypeDecorator classes according
to whether it can be used as a cache key or not [1].
[1] https:/ /docs.sqlalchem y.org/en/ 14/core/ type_api. html#sqlalchemy .types. ExternalType. cache_ok
Closes-Bug: #1921981 30c49909c95fb26 69862d28a3f
Change-Id: I503c93d6e8869b