Skip to content

Commit 2e84599

Browse files
committed
Add failing nested label test case
1 parent 2a41ed7 commit 2e84599

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/test_sqlalchemy_bigquery.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,14 @@ def query():
162162
def query(table):
163163
col1 = literal_column("TIMESTAMP_TRUNC(timestamp, DAY)").label("timestamp_label")
164164
col2 = func.sum(table.c.integer)
165+
# Test rendering of nested labels. Full expression should render in SELECT, but
166+
# ORDER/GROUP BY should use label only.
167+
col3 = func.sum(func.sum(table.c.integer.label("inner")).label("outer")).over().label('outer')
165168
query = (
166169
select([
167170
col1,
168171
col2,
172+
col3,
169173
])
170174
.where(col1 < '2017-01-01 00:00:00')
171175
.group_by(col1)

0 commit comments

Comments
 (0)