diff options
| author | Federico Caselli <cfederico87@gmail.com> | 2020-05-22 23:56:50 +0200 |
|---|---|---|
| committer | Federico Caselli <cfederico87@gmail.com> | 2020-05-22 23:56:50 +0200 |
| commit | d163088de1d68919b6811a25745d3becbbf5b069 (patch) | |
| tree | 6d73976ceae4f0c8ee54b69363782932f96a2071 /test/sql/test_selectable.py | |
| parent | 3fb0eb5a156ab7dbe19d82717dd197d9d22e64f1 (diff) | |
| download | sqlalchemy-d163088de1d68919b6811a25745d3becbbf5b069.tar.gz | |
Correctly apply self_group in type_coerce element.
The type coerce element did not correctly apply grouping rules when using
in an expression
Fixes: #5344
Change-Id: Id67b0e60ac54f8992f931aaed62731672f60c96c
Diffstat (limited to 'test/sql/test_selectable.py')
| -rw-r--r-- | test/sql/test_selectable.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/sql/test_selectable.py b/test/sql/test_selectable.py index 8fb1f2951..e509c9f95 100644 --- a/test/sql/test_selectable.py +++ b/test/sql/test_selectable.py @@ -439,6 +439,13 @@ class SelectableTest( assert isinstance(stmt2.selected_columns.foo.type, MyType) assert isinstance(subq2.c.foo.type, MyType) + def test_type_coerce_selfgroup(self): + no_group = column("a") / type_coerce(column("x"), Integer) + group = column("b") / type_coerce(column("y") * column("w"), Integer) + + self.assert_compile(no_group, "a / x") + self.assert_compile(group, "b / (y * w)") + def test_subquery_on_table(self): sel = select([table1, table2], use_labels=True).subquery() |
