Skip to content

Commit 2fd0945

Browse files
fix sql golden outputs
1 parent 20431f7 commit 2fd0945

File tree

3 files changed

+34
-12
lines changed
  • bigframes/core/rewrite
  • tests/unit/core/compile/sqlglot/aggregations/snapshots/test_nullary_compiler

3 files changed

+34
-12
lines changed

bigframes/core/rewrite/pruning.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ def prune_columns(node: nodes.BigFrameNode):
6262
)
6363
else:
6464
result = node
65-
66-
if len(set(result.ids)) == 0:
67-
raise ValueError()
68-
for child in result.child_nodes:
69-
if len(set(child.ids)) == 0:
70-
raise ValueError()
7165
return result
7266

7367

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
`bool_col` AS `bfcol_0`
3+
`bool_col` AS `bfcol_0`,
4+
`bytes_col` AS `bfcol_1`,
5+
`date_col` AS `bfcol_2`,
6+
`datetime_col` AS `bfcol_3`,
7+
`geography_col` AS `bfcol_4`,
8+
`int64_col` AS `bfcol_5`,
9+
`int64_too` AS `bfcol_6`,
10+
`numeric_col` AS `bfcol_7`,
11+
`float64_col` AS `bfcol_8`,
12+
`rowindex` AS `bfcol_9`,
13+
`rowindex_2` AS `bfcol_10`,
14+
`string_col` AS `bfcol_11`,
15+
`time_col` AS `bfcol_12`,
16+
`timestamp_col` AS `bfcol_13`,
17+
`duration_col` AS `bfcol_14`
418
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
519
), `bfcte_1` AS (
620
SELECT
721
*,
8-
ROW_NUMBER() OVER () AS `bfcol_1`
22+
ROW_NUMBER() OVER () AS `bfcol_32`
923
FROM `bfcte_0`
1024
)
1125
SELECT
12-
`bfcol_1` AS `row_number`
26+
`bfcol_32` AS `row_number`
1327
FROM `bfcte_1`
Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,26 @@
11
WITH `bfcte_0` AS (
22
SELECT
3-
`rowindex` AS `bfcol_0`
3+
`bool_col` AS `bfcol_0`,
4+
`bytes_col` AS `bfcol_1`,
5+
`date_col` AS `bfcol_2`,
6+
`datetime_col` AS `bfcol_3`,
7+
`geography_col` AS `bfcol_4`,
8+
`int64_col` AS `bfcol_5`,
9+
`int64_too` AS `bfcol_6`,
10+
`numeric_col` AS `bfcol_7`,
11+
`float64_col` AS `bfcol_8`,
12+
`rowindex` AS `bfcol_9`,
13+
`rowindex_2` AS `bfcol_10`,
14+
`string_col` AS `bfcol_11`,
15+
`time_col` AS `bfcol_12`,
16+
`timestamp_col` AS `bfcol_13`,
17+
`duration_col` AS `bfcol_14`
418
FROM `bigframes-dev`.`sqlglot_test`.`scalar_types`
519
), `bfcte_1` AS (
620
SELECT
7-
COUNT(1) AS `bfcol_2`
21+
COUNT(1) AS `bfcol_32`
822
FROM `bfcte_0`
923
)
1024
SELECT
11-
`bfcol_2` AS `size`
25+
`bfcol_32` AS `size`
1226
FROM `bfcte_1`

0 commit comments

Comments
 (0)