From: Mike Bayer Date: Thu, 27 Jun 2019 20:07:13 +0000 (-0400) Subject: Use an ordered dict for the previous change X-Git-Tag: rel_1_4_0b1~822 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec2c32bf93cc6fd60db87009643ece32c7926021;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Use an ordered dict for the previous change Change-Id: Iaccb0a82ff053bd73fec59a83d2ee07e899cd6d7 --- diff --git a/test/orm/inheritance/_poly_fixtures.py b/test/orm/inheritance/_poly_fixtures.py index cc253a3806..aa428a5ebc 100644 --- a/test/orm/inheritance/_poly_fixtures.py +++ b/test/orm/inheritance/_poly_fixtures.py @@ -1,6 +1,7 @@ from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import String +from sqlalchemy import util from sqlalchemy.orm import create_session from sqlalchemy.orm import mapper from sqlalchemy.orm import polymorphic_union @@ -385,13 +386,16 @@ class _PolymorphicUnions(_PolymorphicFixtureBase): cls.tables.boss, ) person_join = polymorphic_union( - { - "engineer": people.join(engineers), - "manager": people.join(managers), - }, + util.OrderedDict( + [ + ("engineer", people.join(engineers)), + ("manager", people.join(managers)), + ] + ), None, "pjoin", ) + manager_join = people.join(managers).outerjoin(boss) person_with_polymorphic = ([Person, Manager, Engineer], person_join) manager_with_polymorphic = ("*", manager_join) diff --git a/test/orm/test_of_type.py b/test/orm/test_of_type.py index 375f706944..ce1c9548cf 100644 --- a/test/orm/test_of_type.py +++ b/test/orm/test_of_type.py @@ -273,9 +273,9 @@ class PolymorphicPolymorphicTest( class PolymorphicUnionsTest(_PolymorphicTestBase, _PolymorphicUnions): def _polymorphic_join_target(self, cls): return ( - "(SELECT engineers.person_id AS person_id, " - "people.company_id AS company_id, people.name AS name, " - "people.type AS type, engineers.status AS status, " + "(SELECT engineers.person_id AS person_id, people.company_id " + "AS company_id, people.name AS name, people.type AS type, " + "engineers.status AS status, " "engineers.engineer_name AS engineer_name, " "engineers.primary_language AS primary_language, " "CAST(NULL AS VARCHAR(50)) AS manager_name FROM people "