Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-2819] default__alter_relation_add_remove_columns macro does not use quoting with case sensitive Snowflake relation #1061

Closed
wants to merge 11 commits into from
Closed
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20240717-101810.yaml
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion dbt/include/spark/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}
Expand Down
4 changes: 2 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from dbt.tests.adapter.incremental.test_incremental_on_schema_change import (
BaseIncrementalOnSchemaChangeSetup,
BaseIncrementalCaseSenstivityOnSchemaChange,
)


Expand Down Expand Up @@ -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
Loading