From 761f47ec376547688f1d096bc39fc8ea3d309edf Mon Sep 17 00:00:00 2001 From: Gerda Shank Date: Tue, 7 Nov 2023 10:22:11 -0500 Subject: [PATCH] Support new agate Integer type and test with empty seed --- dbt/adapters/spark/impl.py | 4 ++++ dev-requirements.txt | 4 ++-- tests/functional/adapter/test_simple_seed.py | 5 +++++ 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 tests/functional/adapter/test_simple_seed.py diff --git a/dbt/adapters/spark/impl.py b/dbt/adapters/spark/impl.py index feae34129..16c3a3cb7 100644 --- a/dbt/adapters/spark/impl.py +++ b/dbt/adapters/spark/impl.py @@ -120,6 +120,10 @@ def convert_number_type(cls, agate_table: agate.Table, col_idx: int) -> str: decimals = agate_table.aggregate(agate.MaxPrecision(col_idx)) return "double" if decimals else "bigint" + @classmethod + def convert_integer_type(cls, agate_table: agate.Table, col_idx: int) -> str: + return "bigint" + @classmethod def convert_date_type(cls, agate_table: agate.Table, col_idx: int) -> str: return "date" diff --git a/dev-requirements.txt b/dev-requirements.txt index a6b3dca0e..2abcfa1da 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,7 +1,7 @@ # install latest changes in dbt-core # TODO: how to automate switching from develop to version branches? -git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core -git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-tests-adapter&subdirectory=tests/adapter +git+https://github.com/dbt-labs/dbt-core.git@8895-agate_integer_conversion#egg=dbt-core&subdirectory=core +git+https://github.com/dbt-labs/dbt-core.git@8895-agate_integer_conversion#egg=dbt-tests-adapter&subdirectory=tests/adapter # if version 1.x or greater -> pin to major version # if version 0.x -> pin to minor diff --git a/tests/functional/adapter/test_simple_seed.py b/tests/functional/adapter/test_simple_seed.py new file mode 100644 index 000000000..c610967c6 --- /dev/null +++ b/tests/functional/adapter/test_simple_seed.py @@ -0,0 +1,5 @@ +from dbt.tests.adapter.simple_seed.test_seed import BaseTestEmptySeed + + +class TestBigQueryEmptySeed(BaseTestEmptySeed): + pass