From 3f37a43a8c514ccd6f9636bac51a218b7a1299b5 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Mon, 4 Apr 2022 17:25:53 +0200 Subject: [PATCH] Remove unneeded code in default snapshot materialization (#4993) * Rm unneeded create_schema in snapshot mtlzn * Add changelog entry --- .changes/unreleased/Under the Hood-20220404-144708.yaml | 7 +++++++ .../macros/materializations/snapshots/snapshot.sql | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changes/unreleased/Under the Hood-20220404-144708.yaml diff --git a/.changes/unreleased/Under the Hood-20220404-144708.yaml b/.changes/unreleased/Under the Hood-20220404-144708.yaml new file mode 100644 index 00000000000..5ed2e46caa4 --- /dev/null +++ b/.changes/unreleased/Under the Hood-20220404-144708.yaml @@ -0,0 +1,7 @@ +kind: Under the Hood +body: Remove unneeded create_schema in snapshot materialization +time: 2022-04-04T14:47:08.960642+02:00 +custom: + Author: jtcohen6 + Issue: "4742" + PR: "4993" diff --git a/core/dbt/include/global_project/macros/materializations/snapshots/snapshot.sql b/core/dbt/include/global_project/macros/materializations/snapshots/snapshot.sql index 76a9b5898f7..c1da517c343 100644 --- a/core/dbt/include/global_project/macros/materializations/snapshots/snapshot.sql +++ b/core/dbt/include/global_project/macros/materializations/snapshots/snapshot.sql @@ -6,10 +6,6 @@ {%- set strategy_name = config.get('strategy') -%} {%- set unique_key = config.get('unique_key') %} - {% if not adapter.check_schema_exists(model.database, model.schema) %} - {% do create_schema(model.database, model.schema) %} - {% endif %} - {% set target_relation_exists, target_relation = get_or_create_relation( database=model.database, schema=model.schema,