From a6481310782c3e000527d71161b5822925bcebbe Mon Sep 17 00:00:00 2001 From: Ben Cassell Date: Thu, 26 Oct 2023 11:11:48 -0700 Subject: [PATCH 1/2] additional tests for 1.7.0 --- tests/functional/adapter/test_date_spine.py | 5 +++ .../adapter/test_generate_series.py | 5 +++ .../adapter/test_get_intervals_between.py | 22 ++++++++++++ .../adapter/test_get_powers_of_two.py | 5 +++ tests/functional/adapter/test_show.py | 9 +++++ .../adapter/test_store_failures_as.py | 34 +++++++++++++++++++ 6 files changed, 80 insertions(+) create mode 100644 tests/functional/adapter/test_date_spine.py create mode 100644 tests/functional/adapter/test_generate_series.py create mode 100644 tests/functional/adapter/test_get_intervals_between.py create mode 100644 tests/functional/adapter/test_get_powers_of_two.py create mode 100644 tests/functional/adapter/test_show.py create mode 100644 tests/functional/adapter/test_store_failures_as.py diff --git a/tests/functional/adapter/test_date_spine.py b/tests/functional/adapter/test_date_spine.py new file mode 100644 index 000000000..873f44800 --- /dev/null +++ b/tests/functional/adapter/test_date_spine.py @@ -0,0 +1,5 @@ +from dbt.tests.adapter.utils.test_date_spine import BaseDateSpine + + +class TestDatabricksDateSpine(BaseDateSpine): + pass diff --git a/tests/functional/adapter/test_generate_series.py b/tests/functional/adapter/test_generate_series.py new file mode 100644 index 000000000..22c714abf --- /dev/null +++ b/tests/functional/adapter/test_generate_series.py @@ -0,0 +1,5 @@ +from dbt.tests.adapter.utils.test_generate_series import BaseGenerateSeries + + +class TestDatabricksGenerateSeries(BaseGenerateSeries): + pass diff --git a/tests/functional/adapter/test_get_intervals_between.py b/tests/functional/adapter/test_get_intervals_between.py new file mode 100644 index 000000000..78ad0546c --- /dev/null +++ b/tests/functional/adapter/test_get_intervals_between.py @@ -0,0 +1,22 @@ +from dbt.tests.adapter.utils.test_get_intervals_between import BaseGetIntervalsBetween +from dbt.tests.adapter.utils.fixture_get_intervals_between import ( + models__test_get_intervals_between_yml, +) +import pytest + + +class TestDatabricksGetIntervalBetween(BaseGetIntervalsBetween): + model_sql = """ + SELECT + {{ get_intervals_between('"2023-09-01"', '"2023-09-12"', "day") }} as intervals, + 11 as expected +""" + + @pytest.fixture(scope="class") + def models(self): + return { + "test_get_intervals_between.yml": models__test_get_intervals_between_yml, + "test_get_intervals_between.sql": self.interpolate_macro_namespace( + self.model_sql, "get_intervals_between" + ), + } diff --git a/tests/functional/adapter/test_get_powers_of_two.py b/tests/functional/adapter/test_get_powers_of_two.py new file mode 100644 index 000000000..7c0e6c929 --- /dev/null +++ b/tests/functional/adapter/test_get_powers_of_two.py @@ -0,0 +1,5 @@ +from dbt.tests.adapter.utils.test_get_powers_of_two import BaseGetPowersOfTwo + + +class TestDatabricksGetPowersOfTwo(BaseGetPowersOfTwo): + pass diff --git a/tests/functional/adapter/test_show.py b/tests/functional/adapter/test_show.py new file mode 100644 index 000000000..87ac7323b --- /dev/null +++ b/tests/functional/adapter/test_show.py @@ -0,0 +1,9 @@ +from dbt.tests.adapter.dbt_show.test_dbt_show import BaseShowLimit, BaseShowSqlHeader + + +class TestShowLimitDatabricks(BaseShowLimit): + pass + + +class TestShowSqlHeaderDatabricks(BaseShowSqlHeader): + pass diff --git a/tests/functional/adapter/test_store_failures_as.py b/tests/functional/adapter/test_store_failures_as.py new file mode 100644 index 000000000..b768d1ff5 --- /dev/null +++ b/tests/functional/adapter/test_store_failures_as.py @@ -0,0 +1,34 @@ +from dbt.tests.adapter.store_test_failures_tests.basic import ( + StoreTestFailuresAsInteractions, + StoreTestFailuresAsProjectLevelOff, + StoreTestFailuresAsProjectLevelView, + StoreTestFailuresAsProjectLevelEphemeral, + StoreTestFailuresAsGeneric, + StoreTestFailuresAsExceptions, +) + + +class TestDatabricksStoreTestFailuresAsInteractions(StoreTestFailuresAsInteractions): + pass + + +class TestDatabricksStoreTestFailuresAsProjectLevelOff(StoreTestFailuresAsProjectLevelOff): + pass + + +class TestDatabricksStoreTestFailuresAsProjectLevelView(StoreTestFailuresAsProjectLevelView): + pass + + +class TestDatabricksStoreTestFailuresAsProjectLevelEphemeral( + StoreTestFailuresAsProjectLevelEphemeral +): + pass + + +class TestDatabricksStoreTestFailuresAsGeneric(StoreTestFailuresAsGeneric): + pass + + +class TestDatabricksStoreTestFailuresAsExceptions(StoreTestFailuresAsExceptions): + pass From 7e34c388ee16f5bbdb30ce46fc1221b18e0defca Mon Sep 17 00:00:00 2001 From: Ben Cassell Date: Thu, 26 Oct 2023 11:14:49 -0700 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a2844441..323af9378 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,14 @@ -## dbt-databricks 1.7.x (TBD) +## dbt-databricks 1.7.0 (TBD) ### Features - Added support for getting info only on specified relations to improve performance of gathering metadata ([486](https://github.com/databricks/dbt-databricks/pull/486)) - Added support for getting freshness from metadata ([481](https://github.com/databricks/dbt-databricks/pull/481)) +### Under the Hood + +- Added required adapter tests to ensure compatibility with 1.7.0 ([487](https://github.com/databricks/dbt-databricks/pull/487)) + ## dbt-databricks 1.7.0rc1 (October 13, 2023) ### Fixes