Skip to content

fix(sqlalchemy-bigquery): Support Creation of JSON columns#16733

Merged
parthea merged 1 commit intogoogleapis:mainfrom
waltaskew:json-bigquery
Apr 28, 2026
Merged

fix(sqlalchemy-bigquery): Support Creation of JSON columns#16733
parthea merged 1 commit intogoogleapis:mainfrom
waltaskew:json-bigquery

Conversation

@waltaskew
Copy link
Copy Markdown
Contributor

Fixes #15761

@waltaskew waltaskew requested review from a team as code owners April 20, 2026 20:19
@waltaskew waltaskew requested review from mpovoa and removed request for a team April 20, 2026 20:19
Copy link
Copy Markdown
Contributor

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

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 adds support for the JSON data type in the BigQuery SQLAlchemy dialect by implementing the visit_JSON method and adding a corresponding unit test. Feedback was provided to include a JSONB alias for better compatibility with models using PostgreSQL-specific types.

Comment on lines +625 to +626
def visit_JSON(self, type_, **kw):
return "JSON"
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.

medium

Consider adding an alias for JSONB to improve compatibility with models that use the JSONB type (e.g., those originally designed for PostgreSQL). Since BigQuery's JSON type is binary-optimized, it is the appropriate mapping for JSONB in this dialect.

    def visit_JSON(self, type_, **kw):
        return "JSON"

    visit_JSONB = visit_JSON

@parthea parthea changed the title fix: Support Creation of JSON columns fix(sqlalchemy-bigquery): Support Creation of JSON columns Apr 28, 2026
@parthea parthea added kokoro:force-run Add this label to force Kokoro to re-run the tests. kokoro:run Add this label to force Kokoro to re-run the tests. labels Apr 28, 2026
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Apr 28, 2026
@parthea parthea merged commit 153b82a into googleapis:main Apr 28, 2026
30 of 31 checks passed
jskeet pushed a commit that referenced this pull request May 7, 2026
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v0.12.0
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:234b9d1f2ddb057ed7ac6a38db0bf8163d839c65c6cf88ade52530cddebce59e
<details><summary>bigquery-magics: v0.15.0</summary>

##
[v0.15.0](bigquery-magics-v0.14.0...bigquery-magics-v0.15.0)
(2026-05-06)

### Bug Fixes

* Drop support for Python 3.9 (#16949)
([fab4e71](fab4e712))

</details>


<details><summary>db-dtypes: v1.6.0</summary>

##
[v1.6.0](db-dtypes-v1.5.1...db-dtypes-v1.6.0)
(2026-05-06)

### Features

* enable mypy session for db-dtypes (#16689)
([856731e](856731e1))

</details>


<details><summary>gapic-generator: v1.31.0</summary>

##
[v1.31.0](gapic-generator-v1.30.14...gapic-generator-v1.31.0)
(2026-05-06)

### Features

* add `--resource-name-alias` flag to resolve namespace collisions
(#16769)
([6fc78e5](6fc78e58))

### Bug Fixes

* pass resource aliases to file-level CommonResources (#16945)
([9652a08](9652a08c))

</details>


<details><summary>gcp-sphinx-docfx-yaml: v3.3.0</summary>

##
[v3.3.0](gcp-sphinx-docfx-yaml-v3.2.5...gcp-sphinx-docfx-yaml-v3.3.0)
(2026-05-06)

### Bug Fixes

* provide a hub when traversing a File or Program and no parentPath is
given ([@&amp;#8203;simbahax](https://redirect.github.com/simbahax)) -
`babel-plugin-transform-block-scoping`, `babel-traverse` -
[#&amp;#8203;17737](https://redirect.github.com/babel/babel/pull/17737)
\[7.x backport] fix: Rename switch discriminant references when body
creates shadowing variable
([@&amp;#8203;magic-akari](https://redirect.github.com/magic-akari))
([5098df2](5098df26))

* correctly parse type assertions in `extends` clause
([@&amp;#8203;nicolo-ribaudo](https://redirect.github.com/nicolo-ribaudo))
-
[#&amp;#8203;17723](https://redirect.github.com/babel/babel/pull/17723)
\[7.x backport] fix(parser): improve super type argument parsing
([@&amp;#8203;JLHwung](https://redirect.github.com/JLHwung)) -
`babel-traverse` -
[#&amp;#8203;17708](https://redirect.github.com/babel/babel/pull/17708)
([5098df2](5098df26))

</details>


<details><summary>google-analytics-admin: v0.29.0</summary>

##
[v0.29.0](google-analytics-admin-v0.28.0...google-analytics-admin-v0.29.0)
(2026-05-06)

</details>


<details><summary>google-analytics-data: v0.22.0</summary>

##
[v0.22.0](google-analytics-data-v0.21.0...google-analytics-data-v0.22.0)
(2026-05-06)

</details>


<details><summary>google-apps-chat: v0.9.0</summary>

##
[v0.9.0](google-apps-chat-v0.8.0...google-apps-chat-v0.9.0)
(2026-05-06)

</details>


<details><summary>google-apps-script-type: v0.7.0</summary>

##
[v0.7.0](google-apps-script-type-v0.6.0...google-apps-script-type-v0.7.0)
(2026-05-06)

</details>


<details><summary>google-auth: v2.51.0</summary>

##
[v2.51.0](google-auth-v2.50.0...google-auth-v2.51.0)
(2026-05-06)

### Bug Fixes

* Drop support for Python 3.8 and 3.9 (#16946)
([dcbdd3b](dcbdd3b4))

</details>


<details><summary>google-auth-httplib2: v0.4.0</summary>

##
[v0.4.0](google-auth-httplib2-v0.3.1...google-auth-httplib2-v0.4.0)
(2026-05-06)

### Bug Fixes

* Drop support for Python 3.7, 3.8, and 3.9 (#16937)
([b4fa220](b4fa2200))

</details>


<details><summary>google-auth-oauthlib: v1.4.0</summary>

##
[v1.4.0](google-auth-oauthlib-v1.3.1...google-auth-oauthlib-v1.4.0)
(2026-05-06)

### Bug Fixes

* Drop support for Python 3.9 (#16939)
([25e2a2d](25e2a2dc))

* replace deprecated `utcfromtimestamp` in google-auth-oauthlib (#16732)
([e1c5af7](e1c5af76))

</details>


<details><summary>google-cloud-access-context-manager: v0.5.0</summary>

##
[v0.5.0](google-cloud-access-context-manager-v0.4.0...google-cloud-access-context-manager-v0.5.0)
(2026-05-06)

</details>


<details><summary>google-cloud-biglake-hive: v0.2.0</summary>

##
[v0.2.0](google-cloud-biglake-hive-v0.1.0...google-cloud-biglake-hive-v0.2.0)
(2026-05-06)

</details>


<details><summary>google-cloud-bigquery-reservation: v1.24.0</summary>

##
[v1.24.0](google-cloud-bigquery-reservation-v1.23.0...google-cloud-bigquery-reservation-v1.24.0)
(2026-05-06)

</details>


<details><summary>google-cloud-bigquery-storage: v2.38.0</summary>

##
[v2.38.0](google-cloud-bigquery-storage-v2.37.0...google-cloud-bigquery-storage-v2.38.0)
(2026-05-06)

### Bug Fixes

* provide a hub when traversing a File or Program and no parentPath is
given ([@&amp;#8203;simbahax](https://redirect.github.com/simbahax)) -
`babel-plugin-transform-block-scoping`, `babel-traverse` -
[#&amp;#8203;17737](https://redirect.github.com/babel/babel/pull/17737)
\[7.x backport] fix: Rename switch discriminant references when body
creates shadowing variable
([@&amp;#8203;magic-akari](https://redirect.github.com/magic-akari))
([5098df2](5098df26))

* correctly parse type assertions in `extends` clause
([@&amp;#8203;nicolo-ribaudo](https://redirect.github.com/nicolo-ribaudo))
-
[#&amp;#8203;17723](https://redirect.github.com/babel/babel/pull/17723)
\[7.x backport] fix(parser): improve super type argument parsing
([@&amp;#8203;JLHwung](https://redirect.github.com/JLHwung)) -
`babel-traverse` -
[#&amp;#8203;17708](https://redirect.github.com/babel/babel/pull/17708)
([5098df2](5098df26))

</details>


<details><summary>google-cloud-ces: v0.5.0</summary>

##
[v0.5.0](google-cloud-ces-v0.4.0...google-cloud-ces-v0.5.0)
(2026-05-06)

</details>


<details><summary>google-cloud-chronicle: v0.5.0</summary>

##
[v0.5.0](google-cloud-chronicle-v0.4.0...google-cloud-chronicle-v0.5.0)
(2026-05-06)

</details>


<details><summary>google-cloud-cloudsecuritycompliance: v0.7.0</summary>

##
[v0.7.0](google-cloud-cloudsecuritycompliance-v0.6.0...google-cloud-cloudsecuritycompliance-v0.7.0)
(2026-05-06)

</details>


<details><summary>google-cloud-compute-v1beta: v0.11.0</summary>

##
[v0.11.0](google-cloud-compute-v1beta-v0.10.0...google-cloud-compute-v1beta-v0.11.0)
(2026-05-06)

</details>


<details><summary>google-cloud-config: v0.6.0</summary>

##
[v0.6.0](google-cloud-config-v0.5.0...google-cloud-config-v0.6.0)
(2026-05-06)

</details>


<details><summary>google-cloud-core: v2.6.0</summary>

##
[v2.6.0](google-cloud-core-v2.5.1...google-cloud-core-v2.6.0)
(2026-05-06)

### Bug Fixes

* Drop support for Python 3.9 (#16953)
([78a48b0](78a48b04))

</details>


<details><summary>google-cloud-databasecenter: v0.8.0</summary>

##
[v0.8.0](google-cloud-databasecenter-v0.7.0...google-cloud-databasecenter-v0.8.0)
(2026-05-06)

</details>


<details><summary>google-cloud-datacatalog-lineage-configmanagement:
v0.2.0</summary>

##
[v0.2.0](google-cloud-datacatalog-lineage-configmanagement-v0.1.0...google-cloud-datacatalog-lineage-configmanagement-v0.2.0)
(2026-05-06)

</details>


<details><summary>google-cloud-dataplex: v2.19.0</summary>

##
[v2.19.0](google-cloud-dataplex-v2.18.0...google-cloud-dataplex-v2.19.0)
(2026-05-06)

</details>


<details><summary>google-cloud-discoveryengine: v0.19.0</summary>

##
[v0.19.0](google-cloud-discoveryengine-v0.18.0...google-cloud-discoveryengine-v0.19.0)
(2026-05-06)

</details>


<details><summary>google-cloud-dns: v0.37.0</summary>

##
[v0.37.0](google-cloud-dns-v0.36.1...google-cloud-dns-v0.37.0)
(2026-05-06)

### Bug Fixes

* Drop support for Python 3.9 (#16954)
([5975c48](5975c481))

</details>


<details><summary>google-cloud-documentai-toolbox: v0.16.0</summary>

##
[v0.16.0](google-cloud-documentai-toolbox-v0.15.2...google-cloud-documentai-toolbox-v0.16.0)
(2026-05-06)

</details>


<details><summary>google-cloud-gke-hub: v1.24.0</summary>

##
[v1.24.0](google-cloud-gke-hub-v1.23.0...google-cloud-gke-hub-v1.24.0)
(2026-05-06)

</details>


<details><summary>google-cloud-iam: v2.23.0</summary>

##
[v2.23.0](google-cloud-iam-v2.22.0...google-cloud-iam-v2.23.0)
(2026-05-06)

</details>


<details><summary>google-cloud-kms: v3.13.0</summary>

##
[v3.13.0](google-cloud-kms-v3.12.0...google-cloud-kms-v3.13.0)
(2026-05-06)

</details>


<details><summary>google-cloud-memorystore: v0.5.0</summary>

##
[v0.5.0](google-cloud-memorystore-v0.4.0...google-cloud-memorystore-v0.5.0)
(2026-05-06)

### Features

* enable gRPC transport (#16927)
([71b73e5](71b73e54))

</details>


<details><summary>google-cloud-modelarmor: v0.6.0</summary>

##
[v0.6.0](google-cloud-modelarmor-v0.5.0...google-cloud-modelarmor-v0.6.0)
(2026-05-06)

</details>


<details><summary>google-cloud-ndb: v2.5.0</summary>

##
[v2.5.0](google-cloud-ndb-v2.4.2...google-cloud-ndb-v2.5.0)
(2026-05-06)

### Features

* enable mypy session for ndb (#16691)
([192ccc5](192ccc52))

### Bug Fixes

* Drop support for Python 3.9 (#16950)
([d37a953](d37a9530))

</details>


<details><summary>google-cloud-netapp: v0.10.0</summary>

##
[v0.10.0](google-cloud-netapp-v0.9.0...google-cloud-netapp-v0.10.0)
(2026-05-06)

</details>


<details><summary>google-cloud-network-management: v1.35.0</summary>

##
[v1.35.0](google-cloud-network-management-v1.34.0...google-cloud-network-management-v1.35.0)
(2026-05-06)

</details>


<details><summary>google-cloud-orchestration-airflow: v1.21.0</summary>

##
[v1.21.0](google-cloud-orchestration-airflow-v1.20.0...google-cloud-orchestration-airflow-v1.21.0)
(2026-05-06)

</details>


<details><summary>google-cloud-os-login: v2.21.0</summary>

##
[v2.21.0](google-cloud-os-login-v2.20.0...google-cloud-os-login-v2.21.0)
(2026-05-06)

</details>


<details><summary>google-cloud-policytroubleshooter-iam:
v0.5.0</summary>

##
[v0.5.0](google-cloud-policytroubleshooter-iam-v0.4.0...google-cloud-policytroubleshooter-iam-v0.5.0)
(2026-05-06)

</details>


<details><summary>google-cloud-pubsub: v2.38.0</summary>

##
[v2.38.0](google-cloud-pubsub-v2.37.0...google-cloud-pubsub-v2.38.0)
(2026-05-06)

</details>


<details><summary>google-cloud-redis-cluster: v0.5.0</summary>

##
[v0.5.0](google-cloud-redis-cluster-v0.4.0...google-cloud-redis-cluster-v0.5.0)
(2026-05-06)

</details>


<details><summary>google-cloud-runtimeconfig: v0.37.0</summary>

##
[v0.37.0](google-cloud-runtimeconfig-v0.36.1...google-cloud-runtimeconfig-v0.37.0)
(2026-05-06)

### Bug Fixes

* Drop support for Python 3.9 (#16947)
([e7efd90](e7efd90d))

</details>


<details><summary>google-cloud-saasplatform-saasservicemgmt:
v0.6.0</summary>

##
[v0.6.0](google-cloud-saasplatform-saasservicemgmt-v0.5.0...google-cloud-saasplatform-saasservicemgmt-v0.6.0)
(2026-05-06)

</details>


<details><summary>google-cloud-secret-manager: v2.28.0</summary>

##
[v2.28.0](google-cloud-secret-manager-v2.27.0...google-cloud-secret-manager-v2.28.0)
(2026-05-06)

</details>


<details><summary>google-cloud-spanner: v3.66.0</summary>

##
[v3.66.0](google-cloud-spanner-v3.65.0...google-cloud-spanner-v3.66.0)
(2026-05-06)

### Features

* Add last statement option samples (#16499)
([ee09805](ee098051))

### Bug Fixes

* provide a hub when traversing a File or Program and no parentPath is
given ([@&amp;#8203;simbahax](https://redirect.github.com/simbahax)) -
`babel-plugin-transform-block-scoping`, `babel-traverse` -
[#&amp;#8203;17737](https://redirect.github.com/babel/babel/pull/17737)
\[7.x backport] fix: Rename switch discriminant references when body
creates shadowing variable
([@&amp;#8203;magic-akari](https://redirect.github.com/magic-akari))
([5098df2](5098df26))

* correctly parse type assertions in `extends` clause
([@&amp;#8203;nicolo-ribaudo](https://redirect.github.com/nicolo-ribaudo))
-
[#&amp;#8203;17723](https://redirect.github.com/babel/babel/pull/17723)
\[7.x backport] fix(parser): improve super type argument parsing
([@&amp;#8203;JLHwung](https://redirect.github.com/JLHwung)) -
`babel-traverse` -
[#&amp;#8203;17708](https://redirect.github.com/babel/babel/pull/17708)
([5098df2](5098df26))

</details>


<details><summary>google-cloud-speech: v2.39.0</summary>

##
[v2.39.0](google-cloud-speech-v2.38.0...google-cloud-speech-v2.39.0)
(2026-05-06)

</details>


<details><summary>google-cloud-storagebatchoperations: v0.7.0</summary>

##
[v0.7.0](google-cloud-storagebatchoperations-v0.6.0...google-cloud-storagebatchoperations-v0.7.0)
(2026-05-06)

</details>


<details><summary>google-cloud-testutils: v1.8.0</summary>

##
[v1.8.0](google-cloud-testutils-v1.7.1...google-cloud-testutils-v1.8.0)
(2026-05-06)

### Bug Fixes

* Drop support for Python 3.9 (#16948)
([cdc5dd5](cdc5dd5d))

</details>


<details><summary>google-cloud-vision: v3.14.0</summary>

##
[v3.14.0](google-cloud-vision-v3.13.0...google-cloud-vision-v3.14.0)
(2026-05-06)

</details>


<details><summary>google-cloud-workflows: v1.22.0</summary>

##
[v1.22.0](google-cloud-workflows-v1.21.0...google-cloud-workflows-v1.22.0)
(2026-05-06)

</details>


<details><summary>google-resumable-media: v2.9.0</summary>

##
[v2.9.0](google-resumable-media-v2.8.2...google-resumable-media-v2.9.0)
(2026-05-06)

### Bug Fixes

* Drop support for Python 3.9 (#16938)
([33b5505](33b55050))

</details>


<details><summary>google-shopping-merchant-inventories: v1.4.0</summary>

##
[v1.4.0](google-shopping-merchant-inventories-v1.3.0...google-shopping-merchant-inventories-v1.4.0)
(2026-05-06)

</details>


<details><summary>google-shopping-merchant-products: v1.6.0</summary>

##
[v1.6.0](google-shopping-merchant-products-v1.5.0...google-shopping-merchant-products-v1.6.0)
(2026-05-06)

</details>


<details><summary>google-shopping-merchant-reports: v1.4.0</summary>

##
[v1.4.0](google-shopping-merchant-reports-v1.3.0...google-shopping-merchant-reports-v1.4.0)
(2026-05-06)

</details>


<details><summary>googleapis-common-protos: v1.75.0</summary>

##
[v1.75.0](googleapis-common-protos-v1.74.0...googleapis-common-protos-v1.75.0)
(2026-05-06)

</details>


<details><summary>proto-plus: v1.28.0</summary>

##
[v1.28.0](proto-plus-v1.27.2...proto-plus-v1.28.0)
(2026-05-06)

</details>


<details><summary>sqlalchemy-bigquery: v1.17.0</summary>

##
[v1.17.0](sqlalchemy-bigquery-v1.16.0...sqlalchemy-bigquery-v1.17.0)
(2026-05-06)

### Bug Fixes

* Support Creation of JSON columns (#16733)
([153b82a](153b82a4))

* Drop support for Python 3.8 and 3.9 (#16956)
([63f6d96](63f6d96c))

</details>


<details><summary>sqlalchemy-spanner: v1.18.0</summary>

##
[v1.18.0](sqlalchemy-spanner-v1.17.3...sqlalchemy-spanner-v1.18.0)
(2026-05-06)

### Bug Fixes

* correctly parse type assertions in `extends` clause
([@&amp;#8203;nicolo-ribaudo](https://redirect.github.com/nicolo-ribaudo))
-
[#&amp;#8203;17723](https://redirect.github.com/babel/babel/pull/17723)
\[7.x backport] fix(parser): improve super type argument parsing
([@&amp;#8203;JLHwung](https://redirect.github.com/JLHwung)) -
`babel-traverse` -
[#&amp;#8203;17708](https://redirect.github.com/babel/babel/pull/17708)
([5098df2](5098df26))

* provide a hub when traversing a File or Program and no parentPath is
given ([@&amp;#8203;simbahax](https://redirect.github.com/simbahax)) -
`babel-plugin-transform-block-scoping`, `babel-traverse` -
[#&amp;#8203;17737](https://redirect.github.com/babel/babel/pull/17737)
\[7.x backport] fix: Rename switch discriminant references when body
creates shadowing variable
([@&amp;#8203;magic-akari](https://redirect.github.com/magic-akari))
([5098df2](5098df26))

### Documentation

* fix FAQ grammar in httplib2 example&lt;/li&gt; &lt;li&gt;&lt;a
href=&#34;psf/requests@774a0b837a194ee885d4fdd9ca947900cc3daf71&#34;&gt;&lt;code&gt;774a0b8&lt;/code&gt;&lt;/a&gt;
([07a610c](07a610c5))

* exclude Response.is_permanent_redirect from API docs (&lt;a
href=&#34;https://redirect.github.com/psf/requests/issues/7244&#34;&gt;#7244&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;&lt;a
href=&#34;psf/requests@d568f47278492e630cc990a259047c67991d007a&#34;&gt;&lt;code&gt;d568f47&lt;/code&gt;&lt;/a&gt;
([07a610c](07a610c5))

* same block as other sections&lt;/li&gt; &lt;li&gt;&lt;a
href=&#34;psf/requests@9c72a41bec8597f948c9d8caa5dc3f12273b3303&#34;&gt;&lt;code&gt;9c72a41&lt;/code&gt;&lt;/a&gt;
Bump github/codeql-action from 4.33.0 to 4.34.1&lt;/li&gt;
&lt;li&gt;&lt;a
href=&#34;psf/requests@ebf71906798ec82f34e07d3168f8b8aecaf8a3be&#34;&gt;&lt;code&gt;ebf7190&lt;/code&gt;&lt;/a&gt;
Bump github/codeql-action from 4.32.0 to 4.33.0&lt;/li&gt;
&lt;li&gt;&lt;a
href=&#34;psf/requests@0e4ae38f0c93d4f92a96c774bd52c069d12a4798&#34;&gt;&lt;code&gt;0e4ae38&lt;/code&gt;&lt;/a&gt;
([07a610c](07a610c5))

* clarify Quickstart POST example (&lt;a
href=&#34;https://redirect.github.com/psf/requests/issues/6960&#34;&gt;#6960&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Additional commits viewable in &lt;a
href=&#34;psf/requests@v2.32.5...v2.33.0&#34;&gt;compare
view&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/details&gt; &lt;br /&gt;
([07a610c](07a610c5))

* add AGENTS.md for project guidance and development commands&lt;/li&gt;
&lt;li&gt;Additional commits viewable in &lt;a
href=&#34;andialbrecht/sqlparse@0.5.3...0.5.4&#34;&gt;compare
view&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/details&gt; &lt;br /&gt;
([dbbe4c8](dbbe4c81))

</details>


<details><summary>Bulk Changes</summary>

* chore: update googleapis and regenerate (#16735)
([542857d](542857d5))
Libraries:
google-analytics-admin,google-apps-chat,google-cloud-bigquery-reservation,google-cloud-ces,google-cloud-chronicle,google-cloud-config,google-cloud-databasecenter,google-cloud-dataplex,google-cloud-discoveryengine,google-cloud-iam,google-cloud-kms,google-cloud-modelarmor,google-cloud-netapp,google-cloud-network-management,google-cloud-pubsub,google-cloud-saasplatform-saasservicemgmt,google-shopping-merchant-inventories,google-shopping-merchant-products
</details>
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.

Error Creating Table with JSON Column

4 participants