From b07eb3cb45d1a344759a2eee9d2166fbf3e44888 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 12 Aug 2016 23:35:40 -0400 Subject: Ensure final link in subqueryload join is correct Fixed bug in subquery eager loading where a subqueryload of an "of_type()" object linked to a second subqueryload of a plain mapped class would fail to link the joins correctly. Change-Id: I4be89e6f5e492438464a2ded01eb9c84d7ff7d4e Fixes: #3773 --- lib/sqlalchemy/orm/strategies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/orm') diff --git a/lib/sqlalchemy/orm/strategies.py b/lib/sqlalchemy/orm/strategies.py index 826073215..1d0058ca2 100644 --- a/lib/sqlalchemy/orm/strategies.py +++ b/lib/sqlalchemy/orm/strategies.py @@ -968,7 +968,7 @@ class SubqueryLoader(AbstractRelationshipLoader): if last and effective_entity is not self.mapper: attr = attr.of_type(effective_entity) else: - if last and effective_entity is not self.mapper: + if last: attr = getattr(parent_alias, key).\ of_type(effective_entity) else: -- cgit v1.2.1