Skip to content

Commit

Permalink
Delete snapshot tmp table (#171)
Browse files Browse the repository at this point in the history
* Implement post_snapshot macro

* Use raise_compiler_error
  • Loading branch information
septimit authored Sep 1, 2024
1 parent 9f4ffe7 commit 70536e5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Expected one of: 'append','delete+insert','merge', 'valid_history'
{%- endset %}
{%- if strategy not in ['append','delete+insert','merge', 'valid_history'] %}
{% do exceptions.CompilationError(invalid_strategy_msg) %}
{% do exceptions.raise_compiler_error(invalid_strategy_msg) %}
{%- endif %}
{% do return(strategy) %}
{%- endmacro %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,10 @@
{{ drop_staging_tables_for_valid_history(staging_tables) }}
{% else %}
{% set error_msg= "Failed" %}
{% do exceptions.CompilationError(error_msg) %}
{% do exceptions.raise_compiler_error(error_msg) %}
{% endif %}
{% else %}
{% set error_msg= "Unique key is required for valid_history incremental strategy, please provide unique key in configuration and try again" %}
{% do exceptions.CompilationError(error_msg) %}
{% do exceptions.raise_compiler_error(error_msg) %}
{% endif %}
{% endmacro %}
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,8 @@
) sbq

{% endmacro %}

{% macro teradata__post_snapshot(staging_relation) %}
{{ adapter.dispatch('drop_relation', 'dbt')(staging_relation) }}
{% endmacro %}

0 comments on commit 70536e5

Please sign in to comment.