Skip to content

Commit

Permalink
FEAT: new columns in snapshots for adapters w/o bools (#4871)
Browse files Browse the repository at this point in the history
* FEAT: new columns in snapshots for adapters w/o bools

* trigger gha workflow

* using changie to make changelog

* updating to be on par with main

Co-authored-by: swanderz <swanson.anders@gmail.com>
  • Loading branch information
McKnight-42 and dataders authored Mar 17, 2022
1 parent 62a7163 commit f6a9dae
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .changes/unreleased/Under the Hood-20220316-100305.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
kind: Under the Hood
body: Enable more dialects to snapshot sources with added columns, even those that
don't support boolean datatypes
time: 2022-03-16T10:03:05.96768-05:00
custom:
Author: McKnight-42
Issue: "4488"
PR: "4871"
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- Initial conversion of tests to pytest ([#4690](https://github.com/dbt-labs/dbt-core/issues/4690), [#4691](https://github.com/dbt-labs/dbt-core/pull/4691))
- Fix errors in Windows for tests/functions ([#4781](https://github.com/dbt-labs/dbt-core/issues/4781), [#4767](https://github.com/dbt-labs/dbt-core/pull/4767))


Contributors:
- [@NiallRees](https://github.com/NiallRees) ([#4447](https://github.com/dbt-labs/dbt-core/pull/4447))
- [@alswang18](https://github.com/alswang18) ([#4644](https://github.com/dbt-labs/dbt-core/pull/4644))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
{# no-op #}
{% endmacro %}

{% macro get_true_sql() %}
{{ adapter.dispatch('get_true_sql', 'dbt')() }}
{% endmacro %}

{% macro default__get_true_sql() %}
{{ return('TRUE') }}
{% endmacro %}

{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}
{{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
{%- set row_changed_expr -%}
(
{%- if column_added -%}
TRUE
{{ get_true_sql() }}
{%- else -%}
{%- for col in check_cols -%}
{{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}
Expand Down

0 comments on commit f6a9dae

Please sign in to comment.