Skip to content

Commit

Permalink
Fix replace sql macro (#602)
Browse files Browse the repository at this point in the history
* use get_replace_sql in redshift__get_alter_materialized_view_as_sql

* add changie
  • Loading branch information
colin-rogers-dbt authored Sep 12, 2023
1 parent 538ad79 commit 9bb3883
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changes/unreleased/Fixes-20230912-133327.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
kind: Fixes
body: use get_replace_sql in redshift__get_alter_materialized_view_as_sql
time: 2023-09-12T13:33:27.451042-07:00
custom:
Author: colin-rogers-dbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-- apply a full refresh immediately if needed
{% if configuration_changes.requires_full_refresh %}

{{ get_replace_materialized_view_as_sql(relation, sql, existing_relation, backup_relation, intermediate_relation) }}
{{ get_replace_sql(existing_relation, relation, sql) }}

-- otherwise apply individual changes as needed
{% else %}
Expand Down
5 changes: 3 additions & 2 deletions tests/functional/adapter/materialized_view_tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def run_dbt_and_capture_with_retries_redshift_mv(args: List[str], max_retries: i
try:
# there's no point to using this with expect_pass=False
return run_dbt_and_capture(args, expect_pass=True)
except AssertionError:
except AssertionError as e:
retries += 1
return None
if retries == max_retries:
raise e

0 comments on commit 9bb3883

Please sign in to comment.