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

Fix replace sql macro #602

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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