Skip to content

Commit

Permalink
Fix temp tables cleanup
Browse files Browse the repository at this point in the history
Currently for some reason we have some temp test tables and dbt_models__tmp_
  • Loading branch information
ndrluis committed Aug 7, 2024
1 parent 8572db5 commit 8a8b21f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{% macro clean_elementary_temp_tables() %}
{% do elementary.clean_elementary_test_tables() %}
{% do elementary.edr_log("Deleting dbt_columns temp tables") %}
{% set elementary_database, elementary_schema = elementary.get_package_database_and_schema() %}
{% set dbt_columns_temp_tables_relations = dbt_utils.get_relations_by_pattern(schema_pattern=elementary_schema, table_pattern='%tmp%', database=elementary_database) %}
{% for temp_relation in dbt_columns_temp_tables_relations %}
{% do elementary.edr_log("Deleting temp table - " ~ temp_relation) %}
{% do adapter.drop_relation(temp_relation) %}
{% endfor %}
{% endmacro %}
2 changes: 1 addition & 1 deletion macros/edr/tests/test_utils/clean_up_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
{% for relation in relations %}
{% do adapter.clean_up_table(relation) %}
{% endfor %}
{% endmacro %}
{% endmacro %}
2 changes: 1 addition & 1 deletion macros/utils/table_operations/fully_drop_relation.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
{% macro athena__fully_drop_relation(relation) %}
{% do adapter.clean_up_table(relation) %}
{% do adapter.drop_relation(relation) %}
{% endmacro %}
{% endmacro %}
1 change: 0 additions & 1 deletion macros/utils/table_operations/has_temp_table_support.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@
{% macro athena__has_temp_table_support() %}
{% do return(false) %}
{% endmacro %}

0 comments on commit 8a8b21f

Please sign in to comment.