diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-10-18 16:35:21 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-10-20 11:12:39 -0400 |
| commit | b961505986c0499ba63a0105d1b79aaa6db738a0 (patch) | |
| tree | 56411840c68bd89f2e81a81e4c75eaf4d1f583b0 /test/sql | |
| parent | 4bad8b5a7f48d571bd1e96908299134830ff462f (diff) | |
| download | sqlalchemy-b961505986c0499ba63a0105d1b79aaa6db738a0.tar.gz | |
remove _resolve_label and related attributes
these seem to date back to 0.9 and revs like #3148 but none
of it seems to be affecting things now, try removing it all
and seeing what fails.
we've noted that _resolve_label does not appear to be
needed, however allow_label_resolve remains relevant both
for non-column elements like text() as well as that it is
used explicitly by the joined eager loader.
Change-Id: Ic8a5d8001ef2a4133360f51a92a6f7b0cc389095
Diffstat (limited to 'test/sql')
| -rw-r--r-- | test/sql/test_text.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/sql/test_text.py b/test/sql/test_text.py index 407e8aeb5..15f6f6048 100644 --- a/test/sql/test_text.py +++ b/test/sql/test_text.py @@ -31,6 +31,7 @@ from sqlalchemy.testing import assert_raises_message from sqlalchemy.testing import AssertsCompiledSQL from sqlalchemy.testing import eq_ from sqlalchemy.testing import fixtures +from sqlalchemy.testing.assertions import expect_raises_message from sqlalchemy.types import NullType table1 = table( @@ -813,6 +814,15 @@ class OrderByLabelResolutionTest(fixtures.TestBase, AssertsCompiledSQL): stmt, "SELECT mytable.myid AS foo FROM mytable ORDER BY foo" ) + def test_no_order_by_text(self): + stmt = select(text("foo")).order_by("foo") + + with expect_raises_message( + exc.CompileError, + r"Can't resolve label reference for ORDER BY / GROUP BY / ", + ): + stmt.compile() + def test_order_by_colname(self): stmt = select(table1.c.myid).order_by("name") self.assert_compile( |
