From e62b73d126db886be38596cc4467d54a37183fb6 Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Wed, 7 Feb 2024 11:01:29 -0500 Subject: [PATCH 1/3] setup CI --- dev-requirements.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev-requirements.txt b/dev-requirements.txt index 28a626fc3..6c4d19e81 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,6 +1,8 @@ # install latest changes in dbt-core # TODO: how to automate switching from develop to version branches? -git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter +git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core +git+https://github.com/dbt-labs/dbt-adapters.git@unit-testing-case-insensitive-comparisons +git+https://github.com/dbt-labs/dbt-adapters.git@unit-testing-case-insensitive-comparisons#subdirectory=dbt-tests-adapter # if version 1.x or greater -> pin to major version # if version 0.x -> pin to minor From 57167963c8a9afa0824a6bdd276cdaf7466e5f31 Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Wed, 7 Feb 2024 11:40:06 -0500 Subject: [PATCH 2/3] TestSparkUnitTestCaseInsensitivity, TestSparkUnitTestInvalidInput --- .../adapter/unit_testing/test_unit_testing.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/functional/adapter/unit_testing/test_unit_testing.py diff --git a/tests/functional/adapter/unit_testing/test_unit_testing.py b/tests/functional/adapter/unit_testing/test_unit_testing.py new file mode 100644 index 000000000..998f34b31 --- /dev/null +++ b/tests/functional/adapter/unit_testing/test_unit_testing.py @@ -0,0 +1,10 @@ +from dbt.tests.adapter.unit_testing.test_case_insensitivity import BaseUnitTestCaseInsensivity +from dbt.tests.adapter.unit_testing.test_invalid_input import BaseUnitTestInvalidInput + + +class TestSparkUnitTestCaseInsensitivity(BaseUnitTestCaseInsensivity): + pass + + +class TestSparkUnitTestInvalidInput(BaseUnitTestInvalidInput): + pass From d9258c5d493f0180154b7f958abd80daf24f0281 Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 7 Feb 2024 16:06:36 -0800 Subject: [PATCH 3/3] don't use whole relation when creating temp view --- dbt/include/spark/macros/adapters.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbt/include/spark/macros/adapters.sql b/dbt/include/spark/macros/adapters.sql index bf9f63cf9..079b9d61a 100644 --- a/dbt/include/spark/macros/adapters.sql +++ b/dbt/include/spark/macros/adapters.sql @@ -138,7 +138,7 @@ {#-- We can't use temporary tables with `create ... as ()` syntax --#} {% macro spark__create_temporary_view(relation, compiled_code) -%} - create or replace temporary view {{ relation }} as + create or replace temporary view {{ relation.identifier }} as {{ compiled_code }} {%- endmacro -%} @@ -386,7 +386,7 @@ {% set tmp_relation = base_relation.incorporate(path = { "identifier": tmp_identifier }) -%} - + {%- set tmp_relation = tmp_relation.include(database=false, schema=false) -%} {% do return(tmp_relation) %} {% endmacro %}