Skip to content

Commit 549002d

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fix-nested-labels
2 parents 32acaea + db971fb commit 549002d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

pybigquery/sqlalchemy_bigquery.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ def visit_text(self, type_, **kw):
210210
def visit_string(self, type_, **kw):
211211
return 'STRING'
212212

213+
def visit_ARRAY(self, type_, **kw):
214+
return "ARRAY<{}>".format(self.process(type_.item_type, **kw))
215+
213216
def visit_BINARY(self, type_, **kw):
214217
return 'BYTES'
215218

test/test_sqlalchemy_bigquery.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,16 @@ def test_compiled_query_literal_binds(engine, engine_using_test_dataset, table,
362362
assert len(result) > 0
363363

364364

365+
@pytest.mark.parametrize(["column", "processed"], [
366+
(types.String(), "STRING"),
367+
(types.NUMERIC(), "NUMERIC"),
368+
(types.ARRAY(types.String), "ARRAY<STRING>"),
369+
])
370+
def test_compile_types(engine, column, processed):
371+
result = engine.dialect.type_compiler.process(column)
372+
assert result == processed
373+
374+
365375
def test_joins(session, table, table_one_row):
366376
result = (session.query(table.c.string, func.count(table_one_row.c.integer))
367377
.join(table_one_row, table_one_row.c.string == table.c.string)

0 commit comments

Comments
 (0)