diff --git a/.changes/unreleased/Under the Hood-20240717-101810.yaml b/.changes/unreleased/Under the Hood-20240717-101810.yaml new file mode 100644 index 000000000..6b2ffb778 --- /dev/null +++ b/.changes/unreleased/Under the Hood-20240717-101810.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: update alter_relation_add_remove_columns to use adapter.quote and inherit new test +time: 2024-07-17T10:18:10.178584-05:00 +custom: + Author: McKnight-42 + Issue: "854" diff --git a/dbt/include/spark/macros/adapters.sql b/dbt/include/spark/macros/adapters.sql index a6404a2de..615f4156d 100644 --- a/dbt/include/spark/macros/adapters.sql +++ b/dbt/include/spark/macros/adapters.sql @@ -422,7 +422,7 @@ {% if add_columns %} add columns {% endif %} {% for column in add_columns %} - {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }} + {{ adapter.quote(column.name )}} {{ column.data_type }}{{ ',' if not loop.last }} {% endfor %} {%- endset -%} diff --git a/dev-requirements.txt b/dev-requirements.txt index 055cb92f7..5acff9bea 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -2,8 +2,8 @@ # 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-common.git -git+https://github.com/dbt-labs/dbt-adapters.git -git+https://github.com/dbt-labs/dbt-adapters.git#subdirectory=dbt-tests-adapter +git+https://github.com/dbt-labs/dbt-adapters.git@mcknight/ct-2819 +git+https://github.com/dbt-labs/dbt-adapters.git@mcknight/ct-2819#subdirectory=dbt-tests-adapter # dev ipdb~=0.13.13 diff --git a/tests/functional/adapter/incremental/test_incremental_on_schema_change.py b/tests/functional/adapter/incremental/test_incremental_on_schema_change.py index 478329668..9589d9f01 100644 --- a/tests/functional/adapter/incremental/test_incremental_on_schema_change.py +++ b/tests/functional/adapter/incremental/test_incremental_on_schema_change.py @@ -4,6 +4,7 @@ from dbt.tests.adapter.incremental.test_incremental_on_schema_change import ( BaseIncrementalOnSchemaChangeSetup, + BaseIncrementalCaseSenstivityOnSchemaChange, ) @@ -80,3 +81,8 @@ def test_run_incremental_append_new_columns(self, project): def test_run_incremental_sync_all_columns(self, project): self.run_incremental_sync_all_columns(project) self.run_incremental_sync_remove_only(project) + + +@pytest.mark.skip_profile("apache_spark", "spark_session") +class TestIncrementalCaseSenstivityOnSchemaChange(BaseIncrementalCaseSenstivityOnSchemaChange): + pass