Commit 145034a
authored
** This branch is under testing, not ready for review **
This PR resolves a regression introduced when switching to the default
`sqlglot` compiler, where cast columns lost their aliases during
type-coercion and were auto-named by BigQuery as `f0_`, `f1_`, etc.
(fixes #17394).
Before: screen/7FibgBYoY6EN8hR
After: screen/AWsDt8aocqyzjup
Fixes #<521420846> 🦕
1 parent dd59d36 commit 145034aCopy full SHA for 145034a
9 files changed
+40-15Lines changed: 40 additions & 15 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- packages/bigframes
- bigframes/core
- compile/sqlglot
- tests/unit/core/compile/sqlglot
- expressions
- snapshots
- test_datetime_ops/test_to_datetime
- test_generic_ops
- test_astype_float
- test_astype_string
- snapshots/test_compile_readtable/test_compile_astype_aliases
Expand file treeCollapse file tree
Open diff view settings
Collapse file
packages/bigframes/bigframes/core/compile/sqlglot/sqlglot_ir.py
Copy file name to clipboardExpand all lines: packages/bigframes/bigframes/core/compile/sqlglot/sqlglot_ir.py+5-4Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
249 | 249 | |
250 | 250 | |
251 | 251 | |
252 | | - |
253 | | - |
| 252 | + |
| 253 | + |
| 254 | + |
| 255 | + |
| 256 | + |
254 | 257 | |
255 | 258 | |
256 | | - |
257 | | - |
258 | 259 | |
259 | 260 | |
260 | 261 | |
|
Collapse file
packages/bigframes/bigframes/core/sql_nodes.py
Copy file name to clipboardExpand all lines: packages/bigframes/bigframes/core/sql_nodes.py+8-1Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
276 | 276 | |
277 | 277 | |
278 | 278 | |
279 | | - |
| 279 | + |
| 280 | + |
| 281 | + |
| 282 | + |
| 283 | + |
| 284 | + |
| 285 | + |
| 286 | + |
280 | 287 | |
281 | 288 | |
282 | 289 | |
|
Collapse file
packages/bigframes/tests/unit/core/compile/sqlglot/expressions/snapshots/test_datetime_ops/test_to_datetime/out.sql
Copy file name to clipboard+3-3Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | 2 | |
3 | | - |
| 3 | + |
4 | 4 | |
5 | | - |
| 5 | + |
6 | 6 | |
7 | | - |
| 7 | + |
Collapse file
packages/bigframes/tests/unit/core/compile/sqlglot/expressions/snapshots/test_generic_ops/test_astype_float/out.sql
Copy file name to clipboard+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | | - |
| 2 | + |
3 | 3 | |
4 | 4 | |
5 | | - |
| 5 | + |
Collapse file
packages/bigframes/tests/unit/core/compile/sqlglot/expressions/snapshots/test_generic_ops/test_astype_string/out.sql
Copy file name to clipboard+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
1 | 1 | |
2 | | - |
| 2 | + |
3 | 3 | |
4 | 4 | |
5 | | - |
| 5 | + |
Collapse file
packages/bigframes/tests/unit/core/compile/sqlglot/expressions/test_datetime_ops.py
Copy file name to clipboardExpand all lines: packages/bigframes/tests/unit/core/compile/sqlglot/expressions/test_datetime_ops.py+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
217 | 217 | |
218 | 218 | |
219 | 219 | |
220 | | - |
| 220 | + |
221 | 221 | |
222 | 222 | |
223 | 223 | |
|
Collapse file
packages/bigframes/tests/unit/core/compile/sqlglot/expressions/test_generic_ops.py
Copy file name to clipboardExpand all lines: packages/bigframes/tests/unit/core/compile/sqlglot/expressions/test_generic_ops.py+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | | - |
| 63 | + |
64 | 64 | |
65 | 65 | |
66 | 66 | |
| ||
107 | 107 | |
108 | 108 | |
109 | 109 | |
110 | | - |
| 110 | + |
111 | 111 | |
112 | 112 | |
113 | 113 | |
|
Collapse file
packages/bigframes/tests/unit/core/compile/sqlglot/snapshots/test_compile_readtable/test_compile_astype_aliases/out.sql
Copy file name to clipboard+5Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
Collapse file
packages/bigframes/tests/unit/core/compile/sqlglot/test_compile_readtable.py
Copy file name to clipboardExpand all lines: packages/bigframes/tests/unit/core/compile/sqlglot/test_compile_readtable.py+12Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
80 | 80 | |
81 | 81 | |
82 | 82 | |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
0 commit comments