You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sqlalchemy-bigquery does not support sa.JSON() column type. BigQuery has natively supported the JSON type since 2022, but the SQLAlchemy dialect's BigQueryTypeCompiler has no visit_JSON method.
Error
sqlalchemy.exc.UnsupportedCompilationError: Compiler <sqlalchemy_bigquery.base.BigQueryTypeCompiler>
can't render element of type JSON
This occurs when running Alembic migrations that include sa.Column("my_col", sa.JSON(), ...) against BigQuery.
Description
sqlalchemy-bigquerydoes not supportsa.JSON()column type. BigQuery has natively supported theJSONtype since 2022, but the SQLAlchemy dialect'sBigQueryTypeCompilerhas novisit_JSONmethod.Error
This occurs when running Alembic migrations that include
sa.Column("my_col", sa.JSON(), ...)against BigQuery.Reproduction
Expected behavior
sa.JSON()should compile to BigQuery's nativeJSONtype in DDL statements, since BigQuery supports it.Context
Discovered while setting up Alembic migrations for Metaxy's BigQuery metadata store: anam-org/metaxy#1072
Environment
sqlalchemy-bigquery==1.16.0sqlalchemy==2.0.xalembic==1.15.x