From d0889fdbae91a90cbd1d4194c8c14985b38cc4b4 Mon Sep 17 00:00:00 2001 From: Darius Nicholson <48355301+nicholsondarius@users.noreply.github.com> Date: Tue, 22 Feb 2022 15:58:40 +0000 Subject: [PATCH 1/5] Update relation.sql --- dbt/include/athena/macros/adapters/relation.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt/include/athena/macros/adapters/relation.sql b/dbt/include/athena/macros/adapters/relation.sql index 7e73aca7..0bf4f863 100644 --- a/dbt/include/athena/macros/adapters/relation.sql +++ b/dbt/include/athena/macros/adapters/relation.sql @@ -1,5 +1,5 @@ {% macro athena__drop_relation(relation) -%} - {% if config.get('incremental_strategy') == 'insert_overwrite' %} + {% if config.get('incremental_strategy') != 'append' %} {%- do adapter.clean_up_table(relation.schema, relation.table) -%} {% endif %} {% call statement('drop_relation', auto_begin=False) -%} From 2ffd8594e81a88e53f51c60916c39cccec12b281 Mon Sep 17 00:00:00 2001 From: nicholsondarius Date: Wed, 23 Feb 2022 16:38:29 +0000 Subject: [PATCH 2/5] Ignore python-version --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e36dce96..193f0097 100644 --- a/.gitignore +++ b/.gitignore @@ -141,4 +141,7 @@ cython_debug/ .idea/ # Project specific -test.py \ No newline at end of file +test.py + +# pyenv +.python-version From 199f116544dc49949690624557c24f04b177d8c6 Mon Sep 17 00:00:00 2001 From: nicholsondarius Date: Wed, 23 Feb 2022 16:38:58 +0000 Subject: [PATCH 3/5] Remove incremental strategy conditional --- dbt/include/athena/macros/adapters/relation.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dbt/include/athena/macros/adapters/relation.sql b/dbt/include/athena/macros/adapters/relation.sql index 0bf4f863..7bb26be9 100644 --- a/dbt/include/athena/macros/adapters/relation.sql +++ b/dbt/include/athena/macros/adapters/relation.sql @@ -1,7 +1,5 @@ {% macro athena__drop_relation(relation) -%} - {% if config.get('incremental_strategy') != 'append' %} - {%- do adapter.clean_up_table(relation.schema, relation.table) -%} - {% endif %} + {%- do adapter.clean_up_table(relation.schema, relation.table) -%} {% call statement('drop_relation', auto_begin=False) -%} drop {{ relation.type }} if exists {{ relation }} {%- endcall %} From b626cbdca8db0cb57c2a05655efba197e952c6ae Mon Sep 17 00:00:00 2001 From: nicholsondarius Date: Wed, 23 Feb 2022 17:28:30 +0000 Subject: [PATCH 4/5] Revert change --- dbt/include/athena/macros/adapters/relation.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbt/include/athena/macros/adapters/relation.sql b/dbt/include/athena/macros/adapters/relation.sql index 7bb26be9..0bf4f863 100644 --- a/dbt/include/athena/macros/adapters/relation.sql +++ b/dbt/include/athena/macros/adapters/relation.sql @@ -1,5 +1,7 @@ {% macro athena__drop_relation(relation) -%} - {%- do adapter.clean_up_table(relation.schema, relation.table) -%} + {% if config.get('incremental_strategy') != 'append' %} + {%- do adapter.clean_up_table(relation.schema, relation.table) -%} + {% endif %} {% call statement('drop_relation', auto_begin=False) -%} drop {{ relation.type }} if exists {{ relation }} {%- endcall %} From e8054c97477ac8b19c77e23fa4929ce86248a4b6 Mon Sep 17 00:00:00 2001 From: Darius Nicholson <48355301+nicholsondarius@users.noreply.github.com> Date: Wed, 2 Mar 2022 11:42:47 +0000 Subject: [PATCH 5/5] Update relation.sql --- dbt/include/athena/macros/adapters/relation.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dbt/include/athena/macros/adapters/relation.sql b/dbt/include/athena/macros/adapters/relation.sql index 0bf4f863..7bb26be9 100644 --- a/dbt/include/athena/macros/adapters/relation.sql +++ b/dbt/include/athena/macros/adapters/relation.sql @@ -1,7 +1,5 @@ {% macro athena__drop_relation(relation) -%} - {% if config.get('incremental_strategy') != 'append' %} - {%- do adapter.clean_up_table(relation.schema, relation.table) -%} - {% endif %} + {%- do adapter.clean_up_table(relation.schema, relation.table) -%} {% call statement('drop_relation', auto_begin=False) -%} drop {{ relation.type }} if exists {{ relation }} {%- endcall %}