Skip to content

Commit e17d7eb

Browse files
fix: use dbt.concat() for cross-DB string concatenation in schema changes (fixes Redshift)
Co-Authored-By: Itamar Hartstein <haritamar@gmail.com>
1 parent 1a8635c commit e17d7eb

1 file changed

Lines changed: 24 additions & 10 deletions

File tree

macros/edr/data_monitoring/schema_changes/get_columns_changes_query.sql

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,33 @@
185185
change as test_sub_type,
186186
case
187187
when change = 'column_added'
188-
then concat('The column "', column_name, '" was added')
188+
then
189+
{{
190+
dbt.concat(
191+
["'The column \"'", "column_name", "'\" was added'"]
192+
)
193+
}}
189194
when change = 'column_removed'
190-
then concat('The column "', column_name, '" was removed')
195+
then
196+
{{
197+
dbt.concat(
198+
["'The column \"'", "column_name", "'\" was removed'"]
199+
)
200+
}}
191201
when change = 'type_changed'
192202
then
193-
concat(
194-
'The type of "',
195-
column_name,
196-
'" was changed from ',
197-
pre_data_type,
198-
' to ',
199-
data_type
200-
)
203+
{{
204+
dbt.concat(
205+
[
206+
"'The type of \"'",
207+
"column_name",
208+
"'\" was changed from '",
209+
"pre_data_type",
210+
"' to '",
211+
"data_type",
212+
]
213+
)
214+
}}
201215
else null
202216
end as test_results_description
203217
from all_column_changes {{ elementary.schema_changes_query_group_by() }}

0 commit comments

Comments
 (0)