From ef7ff058eb67d73ebeac7b125ab2a7806e14629c Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Thu, 13 Jun 2019 12:37:22 -0400 Subject: SelectBase no longer a FromClause As part of the SQLAlchemy 2.0 migration project, a conceptual change has been made to the role of the :class:`.SelectBase` class hierarchy, which is the root of all "SELECT" statement constructs, in that they no longer serve directly as FROM clauses, that is, they no longer subclass :class:`.FromClause`. For end users, the change mostly means that any placement of a :func:`.select` construct in the FROM clause of another :func:`.select` requires first that it be wrapped in a subquery first, which historically is through the use of the :meth:`.SelectBase.alias` method, and is now also available through the use of :meth:`.SelectBase.subquery`. This was usually a requirement in any case since several databases don't accept unnamed SELECT subqueries in their FROM clause in any case. See the documentation in this change for lots more detail. Fixes: #4617 Change-Id: I0f6174ee24b9a1a4529168e52e855e12abd60667 --- test/sql/test_resultset.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/sql/test_resultset.py') diff --git a/test/sql/test_resultset.py b/test/sql/test_resultset.py index 6e48374ca..5289ddb77 100644 --- a/test/sql/test_resultset.py +++ b/test/sql/test_resultset.py @@ -1418,8 +1418,8 @@ class KeyTargetingTest(fixtures.TablesTest): in_(keyed2.c.b, row) in_(a, row) in_(b, row) - in_(stmt.c.a, row) - in_(stmt.c.b, row) + in_(stmt.selected_columns.a, row) + in_(stmt.selected_columns.b, row) def test_columnclause_schema_column_four(self): keyed2 = self.tables.keyed2 @@ -1436,8 +1436,8 @@ class KeyTargetingTest(fixtures.TablesTest): in_(keyed2.c.b, row) in_(a, row) in_(b, row) - in_(stmt.c.keyed2_a, row) - in_(stmt.c.keyed2_b, row) + in_(stmt.selected_columns.keyed2_a, row) + in_(stmt.selected_columns.keyed2_b, row) def test_columnclause_schema_column_five(self): keyed2 = self.tables.keyed2 @@ -1451,8 +1451,8 @@ class KeyTargetingTest(fixtures.TablesTest): in_(keyed2.c.a, row) in_(keyed2.c.b, row) - in_(stmt.c.keyed2_a, row) - in_(stmt.c.keyed2_b, row) + in_(stmt.selected_columns.keyed2_a, row) + in_(stmt.selected_columns.keyed2_b, row) class PositionalTextTest(fixtures.TablesTest): -- cgit v1.2.1