Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 548d532

Browse files
authored
Support agate Integer type, test with empty seed (#1004)
1 parent f6e26d0 commit 548d532

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Fixes
2+
body: Support agate Integer type, test with empty seed
3+
time: 2023-11-07T10:09:05.723451-05:00
4+
custom:
5+
Author: gshank
6+
Issue: "1003"

dbt/adapters/bigquery/impl.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ def convert_number_type(cls, agate_table: agate.Table, col_idx: int) -> str:
324324
decimals = agate_table.aggregate(agate.MaxPrecision(col_idx)) # type: ignore[attr-defined]
325325
return "float64" if decimals else "int64"
326326

327+
@classmethod
328+
def convert_integer_type(cls, agate_table: agate.Table, col_idx: int) -> str:
329+
return "int64"
330+
327331
@classmethod
328332
def convert_boolean_type(cls, agate_table: agate.Table, col_idx: int) -> str:
329333
return "bool"

tests/functional/adapter/test_simple_seed.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from dbt.tests.adapter.simple_seed.fixtures import macros__schema_test
33
from dbt.tests.adapter.simple_seed.seeds import seeds__enabled_in_config_csv, seeds__tricky_csv
44
from dbt.tests.adapter.simple_seed.test_seed import SeedConfigBase
5+
from dbt.tests.adapter.simple_seed.test_seed import BaseTestEmptySeed
56
from dbt.tests.adapter.utils.base_utils import run_dbt
67

78

@@ -151,3 +152,7 @@ def test__bigquery_seed_table_with_labels_config_bigquery(self, project):
151152
assert bq_table.labels
152153
assert bq_table.labels == self.table_labels()
153154
assert bq_table.expires
155+
156+
157+
class TestBigQueryEmptySeed(BaseTestEmptySeed):
158+
pass

tests/unit/mock_adapter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ def convert_text_type(self, *args, **kwargs):
5555
def convert_number_type(self, *args, **kwargs):
5656
return self.responder.convert_number_type(*args, **kwargs)
5757

58+
def convert_integer_type(self, *args, **kwargs):
59+
return self.responder.convert_integer_type(*args, **kwargs)
60+
5861
def convert_boolean_type(self, *args, **kwargs):
5962
return self.responder.convert_boolean_type(*args, **kwargs)
6063

0 commit comments

Comments
 (0)