diff --git a/.changes/unreleased/Fixes-20240425-133610.yaml b/.changes/unreleased/Fixes-20240425-133610.yaml new file mode 100644 index 00000000..5d9689f6 --- /dev/null +++ b/.changes/unreleased/Fixes-20240425-133610.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Fix is_replaceable check with wrong variable +time: 2024-04-25T13:36:10.684598+08:00 +custom: + Author: rongfengliang + Issue: "187" diff --git a/dbt/adapters/contracts/connection.py b/dbt/adapters/contracts/connection.py index e3baf284..f3c4647a 100644 --- a/dbt/adapters/contracts/connection.py +++ b/dbt/adapters/contracts/connection.py @@ -226,3 +226,4 @@ class AdapterRequiredConfig(HasCredentials, Protocol): cli_vars: Dict[str, Any] target_path: str log_cache_events: bool + catalogs = Optional[ExternalCatalogConfig] diff --git a/dbt/include/global_project/macros/relations/replace.sql b/dbt/include/global_project/macros/relations/replace.sql index adba77dc..2ba856df 100644 --- a/dbt/include/global_project/macros/relations/replace.sql +++ b/dbt/include/global_project/macros/relations/replace.sql @@ -8,7 +8,7 @@ {# /* use a create or replace statement if possible */ #} - {% set is_replaceable = existing_relation.type == target_relation_type and existing_relation.can_be_replaced %} + {% set is_replaceable = existing_relation.type == target_relation.type and existing_relation.can_be_replaced %} {% if is_replaceable and existing_relation.is_view %} {{ get_replace_view_sql(target_relation, sql) }}