Skip to content
Permalink
Browse files
fix: supports_multivalues_insert dialect option was mispelled (#278)
  • Loading branch information
jimfulton committed Aug 19, 2021
1 parent 691cea9 commit ec36a120c1607d9769105e873550bb727c504c93
Showing with 14 additions and 1 deletion.
  1. +1 −1 sqlalchemy_bigquery/base.py
  2. +13 −0 tests/unit/test_sqlalchemy_bigquery.py
@@ -643,7 +643,7 @@ class BigQueryDialect(DefaultDialect):
supports_pk_autoincrement = False
supports_default_values = False
supports_empty_insert = False
supports_multiline_insert = True
supports_multivalues_insert = True
supports_unicode_statements = True
supports_unicode_binds = True
supports_native_decimal = True
@@ -13,6 +13,8 @@
import pytest
import sqlalchemy

from conftest import setup_table


@pytest.fixture
def mock_bigquery_client():
@@ -158,3 +160,14 @@ def test__remove_type_from_empty_in(inp, outp):

r = BigQueryExecutionContext._BigQueryExecutionContext__remove_type_from_empty_in
assert r(None, inp) == outp


def test_multi_value_insert(faux_conn, last_query):
table = setup_table(faux_conn, "t", sqlalchemy.Column("id", sqlalchemy.Integer))
faux_conn.execute(table.insert().values([dict(id=i) for i in range(3)]))

last_query(
"INSERT INTO `t` (`id`) VALUES"
" (%(id_m0:INT64)s), (%(id_m1:INT64)s), (%(id_m2:INT64)s)",
{"id_m0": 0, "id_m1": 1, "id_m2": 2},
)

0 comments on commit ec36a12

Please sign in to comment.