From 129cab7f923361170fc4faa58bf80c7ef5b6abda Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 8 Nov 2023 15:20:34 -0800 Subject: [PATCH] Support new agate Integer type and test with empty seed (#936) (#941) * Support new agate Integer type and test with empty seed * add changie, remove branch reference (cherry picked from commit 0f39bd1410d7cc95cfae8b661c6080e7fd99cc01) Co-authored-by: Gerda Shank --- .changes/unreleased/Fixes-20231107-134141.yaml | 6 ++++++ dbt/adapters/spark/impl.py | 4 ++++ tests/functional/adapter/test_simple_seed.py | 5 +++++ 3 files changed, 15 insertions(+) create mode 100644 .changes/unreleased/Fixes-20231107-134141.yaml create mode 100644 tests/functional/adapter/test_simple_seed.py diff --git a/.changes/unreleased/Fixes-20231107-134141.yaml b/.changes/unreleased/Fixes-20231107-134141.yaml new file mode 100644 index 000000000..d4f56eaca --- /dev/null +++ b/.changes/unreleased/Fixes-20231107-134141.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Support new agate Integer type and empty seed test +time: 2023-11-07T13:41:41.033441-05:00 +custom: + Author: gshank + Issue: "935" diff --git a/dbt/adapters/spark/impl.py b/dbt/adapters/spark/impl.py index 2864c4f30..760764157 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/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