diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-02-23 13:55:17 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2018-02-23 14:19:13 -0500 |
commit | 3859256312c8114ca7104f59c90f68623893a630 (patch) | |
tree | 31fbe5c0a8b6e892129ac317b7240d57c82826f7 /lib/sqlalchemy/orm/loading.py | |
parent | f7dcac6967b3068b2dc2209cd4c6bf966206f8e9 (diff) | |
download | sqlalchemy-3859256312c8114ca7104f59c90f68623893a630.tar.gz |
Ensure we have states to load when doing poly post load
Fixed bug in new "polymorphic selectin" loading when a selection of
polymorphic objects were to be partially loaded from a relationship
lazy loader, leading to an "empty IN" condition within the load that
raises an error for the "inline" form of "IN".
Change-Id: I721cf5fdf0b9fd2289067d5d2c6bc87fb2436f07
Fixes: #4199
Diffstat (limited to 'lib/sqlalchemy/orm/loading.py')
-rw-r--r-- | lib/sqlalchemy/orm/loading.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/loading.py b/lib/sqlalchemy/orm/loading.py index 2544f7f99..2628093e0 100644 --- a/lib/sqlalchemy/orm/loading.py +++ b/lib/sqlalchemy/orm/loading.py @@ -755,8 +755,8 @@ class PostLoad(object): in self.states.items() if state.manager.mapper.isa(limit_to_mapper) ] - loader( - context, path, states, self.load_keys, *arg, **kw) + if states: + loader(context, path, states, self.load_keys, *arg, **kw) self.states.clear() @classmethod |