From d163088de1d68919b6811a25745d3becbbf5b069 Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Fri, 22 May 2020 23:56:50 +0200 Subject: 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 --- test/sql/test_selectable.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/sql') 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() -- cgit v1.2.1