diff --git a/.changes/unreleased/Fixes-20230912-133327.yaml b/.changes/unreleased/Fixes-20230912-133327.yaml new file mode 100644 index 000000000..afa2f3657 --- /dev/null +++ b/.changes/unreleased/Fixes-20230912-133327.yaml @@ -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 diff --git a/dbt/include/redshift/macros/relations/materialized_view/alter.sql b/dbt/include/redshift/macros/relations/materialized_view/alter.sql index 6165e441d..7f0379847 100644 --- a/dbt/include/redshift/macros/relations/materialized_view/alter.sql +++ b/dbt/include/redshift/macros/relations/materialized_view/alter.sql @@ -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 %} diff --git a/tests/functional/adapter/materialized_view_tests/utils.py b/tests/functional/adapter/materialized_view_tests/utils.py index bc172be69..112ae3057 100644 --- a/tests/functional/adapter/materialized_view_tests/utils.py +++ b/tests/functional/adapter/materialized_view_tests/utils.py @@ -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