We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36ca46b commit 153b82aCopy full SHA for 153b82a
2 files changed
packages/sqlalchemy-bigquery/sqlalchemy_bigquery/base.py
@@ -622,6 +622,9 @@ def visit_BINARY(self, type_, **kw):
622
623
visit_VARBINARY = visit_BLOB = visit_BINARY
624
625
+ def visit_JSON(self, type_, **kw):
626
+ return "JSON"
627
+
628
def visit_NUMERIC(self, type_, **kw):
629
if (type_.precision is not None) and isinstance(
630
kw.get("type_expression"), Column
packages/sqlalchemy-bigquery/tests/unit/test_table_options.py
@@ -62,6 +62,18 @@ def test_table_default_rounding_mode_dialect_option(faux_conn):
62
)
63
64
65
+def test_table_with_json_columns(faux_conn):
66
+ setup_table(
67
+ faux_conn,
68
+ "some_table",
69
+ sqlalchemy.Column("some_stuff", sqlalchemy.JSON),
70
+ )
71
72
+ assert " ".join(faux_conn.test_data["execute"][-1][0].strip().split()) == (
73
+ "CREATE TABLE `some_table` ( `some_stuff` JSON )"
74
75
76
77
def test_table_clustering_fields_dialect_option_no_such_column(faux_conn):
78
with pytest.raises(sqlalchemy.exc.NoSuchColumnError):
79
setup_table(
0 commit comments