diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2020-05-28 19:28:35 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-05-28 19:28:35 +0000 |
| commit | 056bad48e2bc948a08621ab841fd882cb6934262 (patch) | |
| tree | 2635059b149309c2ad7a648bfce13fd5844d8dc8 /lib/sqlalchemy/sql/traversals.py | |
| parent | c07979e8d44a30fdf0ea73bc587aa05a52e9955a (diff) | |
| parent | 77f1b7d236dba6b1c859bb428ef32d118ec372e6 (diff) | |
| download | sqlalchemy-056bad48e2bc948a08621ab841fd882cb6934262.tar.gz | |
Merge "callcount reductions and refinement for cached queries"
Diffstat (limited to 'lib/sqlalchemy/sql/traversals.py')
| -rw-r--r-- | lib/sqlalchemy/sql/traversals.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/sqlalchemy/sql/traversals.py b/lib/sqlalchemy/sql/traversals.py index 482248ada..a38088a27 100644 --- a/lib/sqlalchemy/sql/traversals.py +++ b/lib/sqlalchemy/sql/traversals.py @@ -179,7 +179,7 @@ class HasCacheKey(object): if NO_CACHE in _anon_map: return None else: - return CacheKey(key, bindparams, self) + return CacheKey(key, bindparams) @classmethod def _generate_cache_key_for_object(cls, obj): @@ -190,7 +190,7 @@ class HasCacheKey(object): if NO_CACHE in _anon_map: return None else: - return CacheKey(key, bindparams, obj) + return CacheKey(key, bindparams) class MemoizedHasCacheKey(HasCacheKey, HasMemoized): @@ -199,13 +199,13 @@ class MemoizedHasCacheKey(HasCacheKey, HasMemoized): return HasCacheKey._generate_cache_key(self) -class CacheKey(namedtuple("CacheKey", ["key", "bindparams", "statement"])): +class CacheKey(namedtuple("CacheKey", ["key", "bindparams"])): def __hash__(self): """CacheKey itself is not hashable - hash the .key portion""" return None - def to_offline_string(self, statement_cache, parameters): + def to_offline_string(self, statement_cache, statement, parameters): """generate an "offline string" form of this :class:`.CacheKey` The "offline string" is basically the string SQL for the @@ -222,7 +222,7 @@ class CacheKey(namedtuple("CacheKey", ["key", "bindparams", "statement"])): """ if self.key not in statement_cache: - statement_cache[self.key] = sql_str = str(self.statement) + statement_cache[self.key] = sql_str = str(statement) else: sql_str = statement_cache[self.key] |
