Skip to content

fix: emit bracketed inline array syntax for scalar subquery expressions - #17716

Merged
shuoweil merged 6 commits into
mainfrom
shuowei-fix-sqlglot-array-syntax
Jul 16, 2026
Merged

fix: emit bracketed inline array syntax for scalar subquery expressions#17716
shuoweil merged 6 commits into
mainfrom
shuowei-fix-sqlglot-array-syntax

Conversation

@shuoweil

Copy link
Copy Markdown
Contributor

Fixes a SQLGlot transpilation bug in BigQuery array generation where single-element arrays containing scalar subqueries wrapped in expressions (e.g., COALESCE(CAST(...)) or ROUND(...)) produced invalid BigQuery SQL syntax ARRAY(COALESCE(...)), causing BigQuery 400 Syntax error: Unexpected identifier "COALESCE" errors on .cache().

Verified at:
before: screen/9AmutJHVDJuafwm
after: screen/u7aW9tTLB8ybUFW

Fixes #<534824500> 🦕

@shuoweil shuoweil self-assigned this Jul 14, 2026
@shuoweil
shuoweil requested review from a team as code owners July 14, 2026 23:01

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the inline_array_unless_query function in the vendored sqlglot dialect to more precisely detect when an array expression contains a single query or subquery. It also adds a corresponding unit test and snapshot to verify that ToArrayOp correctly compiles with a subquery expression. There are no review comments to address, and the changes look solid.

@shuoweil
shuoweil marked this pull request as draft July 14, 2026 23:46
@shuoweil
shuoweil marked this pull request as ready for review July 16, 2026 00:19
@shuoweil
shuoweil merged commit ce5fd50 into main Jul 16, 2026
39 of 40 checks passed
@shuoweil
shuoweil deleted the shuowei-fix-sqlglot-array-syntax branch July 16, 2026 17:50
shuoweil pushed a commit that referenced this pull request Jul 16, 2026
🤖 I have created a release *beep* *boop*
---


##
[2.46.0](bigframes-v2.45.0...bigframes-v2.46.0)
(2026-07-16)


### Features

* **bigframes:** Support groupby.agg/transform with udf transpiler
([#17613](#17613))
([cae94f9](cae94f9))
* **bigframes:** support offset-based column access via iloc
([#17367](#17367))
([4253fab](4253fab))


### Bug Fixes

* **bigframes:** Fix sqlglot backend regressions
([#17655](#17655))
([91f93bc](91f93bc))
* bump gradio from 6.15.0 to 6.15.1 in /packages/bigframes
([#17712](#17712))
([a85d59f](a85d59f))
* bump mistune from 3.2.1 to 3.3.0 in /packages/bigframes
([#17694](#17694))
([e5f7fef](e5f7fef))
* bump soupsieve from 2.7 to 2.8.4 in /packages/bigframes
([#17695](#17695))
([635da34](635da34))
* bump transformers from 5.3.0 to 5.5.0 in /packages/bigframes
([#17700](#17700))
([4b049c4](4b049c4))
* emit bracketed inline array syntax for scalar subquery expressions
([#17716](#17716))
([ce5fd50](ce5fd50))


### Documentation

* make landing page quickstart runnable
([fc423c8](fc423c8))
* make landing page quickstart runnable
([#17687](#17687))
([fc423c8](fc423c8))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants