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 #1108

Closed
wants to merge 10 commits into from
6 changes: 6 additions & 0 deletions .changes/unreleased/Under the Hood-20240709-143950.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Under the Hood
body: update snowflake__alter_relation_add_remove_columns to use adapter.quote
time: 2024-07-09T14:39:50.639829-05:00
custom:
Author: McKnight-42
Issue: "1108"
4 changes: 2 additions & 2 deletions dbt/include/snowflake/macros/adapters.sql
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
{% set sql -%}
alter {{ relation_type }} {{ relation.render() }} add column
{% 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 All @@ -281,7 +281,7 @@
{% set sql -%}
alter {{ relation_type }} {{ relation.render() }} drop column
{% for column in remove_columns %}
{{ column.name }}{{ ',' if not loop.last }}
{{ adapter.quote(column.name) }} {{ ',' if not loop.last }}
{% endfor %}
{%- endset -%}

Expand Down
5 changes: 3 additions & 2 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# install latest changes in dbt-core
git+https://github.com/dbt-labs/dbt-core.git#egg=dbt-core&subdirectory=core
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

git+https://github.com/dbt-labs/dbt-common.git

# dev
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
from dbt.tests.adapter.incremental.test_incremental_on_schema_change import (
BaseIncrementalOnSchemaChange,
BaseIncrementalCaseSenstivityOnSchemaChange,
)


class TestIncrementalOnSchemaChange(BaseIncrementalOnSchemaChange):
pass


class TestIncrementalCaseSenstivityOnSchemaChange(BaseIncrementalCaseSenstivityOnSchemaChange):
pass
Loading