diff options
Diffstat (limited to 'lib/sqlalchemy/ext')
-rw-r--r-- | lib/sqlalchemy/ext/baked.py | 8 | ||||
-rw-r--r-- | lib/sqlalchemy/ext/horizontal_shard.py | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/sqlalchemy/ext/baked.py b/lib/sqlalchemy/ext/baked.py index e642a83d5..97c825f02 100644 --- a/lib/sqlalchemy/ext/baked.py +++ b/lib/sqlalchemy/ext/baked.py @@ -200,6 +200,12 @@ class BakedQuery(object): if ck is None: self.spoil(full=True) else: + assert not ck[1], ( + "loader options with variable bound parameters " + "not supported with baked queries. Please " + "use new-style select() statements for cached " + "ORM queries." + ) key += ck[0] self.add_criteria( @@ -395,7 +401,7 @@ class Result(object): for fn in self._post_criteria: q = fn(q) - params = q.load_options._params + params = q._params execution_options = dict(q._execution_options) execution_options.update( { diff --git a/lib/sqlalchemy/ext/horizontal_shard.py b/lib/sqlalchemy/ext/horizontal_shard.py index 786d00597..53545826b 100644 --- a/lib/sqlalchemy/ext/horizontal_shard.py +++ b/lib/sqlalchemy/ext/horizontal_shard.py @@ -207,13 +207,10 @@ class ShardedSession(Session): def execute_and_instances(orm_context): - params = orm_context.parameters if orm_context.is_select: load_options = active_options = orm_context.load_options update_options = None - if params is None: - params = active_options._params else: load_options = None |