From a1006c152f1245a7cf399fe099c9f5e5430bddce Mon Sep 17 00:00:00 2001 From: Adrian Burus Date: Tue, 17 Dec 2024 11:01:20 +0200 Subject: [PATCH 1/9] Added equals macro to handle null value comparison --- .../dbt/tests/adapter/utils/base_utils.py | 10 ---------- .../dbt/tests/adapter/utils/test_equals.py | 8 +------- .../materializations/models/incremental/merge.sql | 6 +++--- .../macros/materializations/snapshots/helpers.sql | 5 ++--- .../materializations/snapshots/snapshot_merge.sql | 4 ++-- dbt/include/global_project/macros/utils/equals.sql | 11 +++++++++++ 6 files changed, 19 insertions(+), 25 deletions(-) create mode 100644 dbt/include/global_project/macros/utils/equals.sql diff --git a/dbt-tests-adapter/dbt/tests/adapter/utils/base_utils.py b/dbt-tests-adapter/dbt/tests/adapter/utils/base_utils.py index 23e1ca7f..000b1cf9 100644 --- a/dbt-tests-adapter/dbt/tests/adapter/utils/base_utils.py +++ b/dbt-tests-adapter/dbt/tests/adapter/utils/base_utils.py @@ -1,16 +1,6 @@ import pytest from dbt.tests.util import run_dbt - -macros__equals_sql = """ -{% macro equals(expr1, expr2) -%} -case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null)) - then 0 - else 1 -end = 0 -{% endmacro %} -""" - macros__test_assert_equal_sql = """ {% test assert_equal(model, actual, expected) %} select * from {{ model }} diff --git a/dbt-tests-adapter/dbt/tests/adapter/utils/test_equals.py b/dbt-tests-adapter/dbt/tests/adapter/utils/test_equals.py index c61f6fdf..d8596dc0 100644 --- a/dbt-tests-adapter/dbt/tests/adapter/utils/test_equals.py +++ b/dbt-tests-adapter/dbt/tests/adapter/utils/test_equals.py @@ -1,16 +1,10 @@ import pytest -from dbt.tests.adapter.utils import base_utils, fixture_equals +from dbt.tests.adapter.utils import fixture_equals from dbt.tests.util import relation_from_name, run_dbt class BaseEquals: - @pytest.fixture(scope="class") - def macros(self): - return { - "equals.sql": base_utils.macros__equals_sql, - } - @pytest.fixture(scope="class") def seeds(self): return { diff --git a/dbt/include/global_project/macros/materializations/models/incremental/merge.sql b/dbt/include/global_project/macros/materializations/models/incremental/merge.sql index ca972c9f..2f9c2dee 100644 --- a/dbt/include/global_project/macros/materializations/models/incremental/merge.sql +++ b/dbt/include/global_project/macros/materializations/models/incremental/merge.sql @@ -22,7 +22,7 @@ {% endfor %} {% else %} {% set unique_key_match %} - DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }} + {{ adapter.dispatch('equals', 'dbt')(DBT_INTERNAL_SOURCE.{{ unique_key }}, DBT_INTERNAL_DEST.{{ unique_key }}) }} {% endset %} {% do predicates.append(unique_key_match) %} {% endif %} @@ -62,11 +62,11 @@ {% if unique_key %} {% if unique_key is sequence and unique_key is not string %} - delete from {{target }} + delete from {{ target }} using {{ source }} where ( {% for key in unique_key %} - {{ source }}.{{ key }} = {{ target }}.{{ key }} + {{ adapter.dispatch('equals', 'dbt')({{ source }}.{{ key }}, {{ target }}.{{ key }}) }} {{ "and " if not loop.last}} {% endfor %} {% if incremental_predicates %} diff --git a/dbt/include/global_project/macros/materializations/snapshots/helpers.sql b/dbt/include/global_project/macros/materializations/snapshots/helpers.sql index 33492cc9..f72e71e0 100644 --- a/dbt/include/global_project/macros/materializations/snapshots/helpers.sql +++ b/dbt/include/global_project/macros/materializations/snapshots/helpers.sql @@ -53,8 +53,7 @@ from {{ target_relation }} where {% if config.get('dbt_valid_to_current') %} - {# Check for either dbt_valid_to_current OR null, in order to correctly update records with nulls #} - ( {{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ columns.dbt_valid_to }} is null) + {{ adapter.dispatch('equals', 'dbt')({{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }} {% else %} {{ columns.dbt_valid_to }} is null {% endif %} @@ -276,7 +275,7 @@ {% macro unique_key_join_on(unique_key, identifier, from_identifier) %} {% if unique_key | is_list %} {% for key in unique_key %} - {{ identifier }}.dbt_unique_key_{{ loop.index }} = {{ from_identifier }}.dbt_unique_key_{{ loop.index }} + {{ adapter.dispatch('equals', 'dbt')({{ identifier }}.dbt_unique_key_{{ loop.index }}, {{ from_identifier }}.dbt_unique_key_{{ loop.index }}) }} {%- if not loop.last %} and {%- endif %} {% endfor %} {% else %} diff --git a/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql b/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql index cf787e4f..2ecece09 100644 --- a/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql +++ b/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql @@ -15,8 +15,8 @@ when matched {% if config.get("dbt_valid_to_current") %} - and (DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or - DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null) + and {{ adapter.dispatch('equals', 'dbt')(DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }} + {% else %} and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null {% endif %} diff --git a/dbt/include/global_project/macros/utils/equals.sql b/dbt/include/global_project/macros/utils/equals.sql new file mode 100644 index 00000000..216cdcd8 --- /dev/null +++ b/dbt/include/global_project/macros/utils/equals.sql @@ -0,0 +1,11 @@ +{% macro equals(first_date, second_date, datepart) -%} + {{ return(adapter.dispatch('equals', 'dbt') (expression)) }} +{%- endmacro %} + +{% macro defaults__equals(expr1, expr2) -%} +case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null)) + then 0 + else 1 +end = 0 +{% endmacro %} + From 7e816bebc5965880ca88ca4b199f0b4afa918ef6 Mon Sep 17 00:00:00 2001 From: Adrian Burus Date: Tue, 17 Dec 2024 11:06:05 +0200 Subject: [PATCH 2/9] Changelog update --- .changes/unreleased/Under the Hood-20241217-110536.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Under the Hood-20241217-110536.yaml diff --git a/.changes/unreleased/Under the Hood-20241217-110536.yaml b/.changes/unreleased/Under the Hood-20241217-110536.yaml new file mode 100644 index 00000000..5716da5e --- /dev/null +++ b/.changes/unreleased/Under the Hood-20241217-110536.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: Added new equals macro that handles null value checks in sql +time: 2024-12-17T11:05:36.363421+02:00 +custom: + Author: adrianburusdbt + Issue: "159" From 70afd18a8e5f63652935914ef325a46471fcc8db Mon Sep 17 00:00:00 2001 From: Adrian Burus Date: Tue, 17 Dec 2024 11:28:00 +0200 Subject: [PATCH 3/9] Update equals.sql macro --- .../global_project/macros/utils/equals.sql | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/dbt/include/global_project/macros/utils/equals.sql b/dbt/include/global_project/macros/utils/equals.sql index 216cdcd8..adb75b92 100644 --- a/dbt/include/global_project/macros/utils/equals.sql +++ b/dbt/include/global_project/macros/utils/equals.sql @@ -1,11 +1,12 @@ -{% macro equals(first_date, second_date, datepart) -%} - {{ return(adapter.dispatch('equals', 'dbt') (expression)) }} +{% macro equals(first_date, second_date, datepart) %} + {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }} {%- endmacro %} -{% macro defaults__equals(expr1, expr2) -%} -case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null)) - then 0 - else 1 -end = 0 -{% endmacro %} +{% macro default__equals(expr1, expr2) -%} + case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null)) + then 0 + else 1 + end = 0 + +{% endmacro %} \ No newline at end of file From b8312d6c02c9de2f842654bb07dad6437c3e6458 Mon Sep 17 00:00:00 2001 From: Adrian Burus Date: Tue, 17 Dec 2024 11:30:11 +0200 Subject: [PATCH 4/9] Remved unused test fixture --- dbt-tests-adapter/dbt/tests/adapter/utils/base_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dbt-tests-adapter/dbt/tests/adapter/utils/base_utils.py b/dbt-tests-adapter/dbt/tests/adapter/utils/base_utils.py index 000b1cf9..943b2aa8 100644 --- a/dbt-tests-adapter/dbt/tests/adapter/utils/base_utils.py +++ b/dbt-tests-adapter/dbt/tests/adapter/utils/base_utils.py @@ -23,7 +23,6 @@ class BaseUtils: @pytest.fixture(scope="class") def macros(self): return { - "equals.sql": macros__equals_sql, "test_assert_equal.sql": macros__test_assert_equal_sql, "replace_empty.sql": macros__replace_empty_sql, } From 85c954f702ed3a0da1302e19300aef891e2a9a40 Mon Sep 17 00:00:00 2001 From: Adrian Burus Date: Tue, 17 Dec 2024 15:31:23 +0200 Subject: [PATCH 5/9] Attempt to fix end of file error --- dbt/include/global_project/macros/utils/equals.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt/include/global_project/macros/utils/equals.sql b/dbt/include/global_project/macros/utils/equals.sql index adb75b92..2920b7b0 100644 --- a/dbt/include/global_project/macros/utils/equals.sql +++ b/dbt/include/global_project/macros/utils/equals.sql @@ -9,4 +9,4 @@ else 1 end = 0 -{% endmacro %} \ No newline at end of file +{% endmacro %} From 7565deaf079898cbbb65328d69e70734e3b79ef1 Mon Sep 17 00:00:00 2001 From: Adrian Burus Date: Tue, 17 Dec 2024 15:39:41 +0200 Subject: [PATCH 6/9] Trim trailing whitespace --- .../macros/materializations/snapshots/snapshot_merge.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql b/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql index 2ecece09..2d10d153 100644 --- a/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql +++ b/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql @@ -16,7 +16,7 @@ when matched {% if config.get("dbt_valid_to_current") %} and {{ adapter.dispatch('equals', 'dbt')(DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }} - + {% else %} and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null {% endif %} From d582ab105f0d3db273071e4d46ea53a7a4e45669 Mon Sep 17 00:00:00 2001 From: Adrian Burus Date: Tue, 17 Dec 2024 20:14:37 +0200 Subject: [PATCH 7/9] PR comments --- .../macros/materializations/models/incremental/merge.sql | 4 ++-- .../macros/materializations/snapshots/helpers.sql | 4 ++-- .../macros/materializations/snapshots/snapshot_merge.sql | 2 +- dbt/include/global_project/macros/utils/equals.sql | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dbt/include/global_project/macros/materializations/models/incremental/merge.sql b/dbt/include/global_project/macros/materializations/models/incremental/merge.sql index 2f9c2dee..c5920716 100644 --- a/dbt/include/global_project/macros/materializations/models/incremental/merge.sql +++ b/dbt/include/global_project/macros/materializations/models/incremental/merge.sql @@ -22,7 +22,7 @@ {% endfor %} {% else %} {% set unique_key_match %} - {{ adapter.dispatch('equals', 'dbt')(DBT_INTERNAL_SOURCE.{{ unique_key }}, DBT_INTERNAL_DEST.{{ unique_key }}) }} + {{ equals(DBT_INTERNAL_SOURCE.{{ unique_key }}, DBT_INTERNAL_DEST.{{ unique_key }}) }} {% endset %} {% do predicates.append(unique_key_match) %} {% endif %} @@ -66,7 +66,7 @@ using {{ source }} where ( {% for key in unique_key %} - {{ adapter.dispatch('equals', 'dbt')({{ source }}.{{ key }}, {{ target }}.{{ key }}) }} + {{ equals({{ source }}.{{ key }}, {{ target }}.{{ key }}) }} {{ "and " if not loop.last}} {% endfor %} {% if incremental_predicates %} diff --git a/dbt/include/global_project/macros/materializations/snapshots/helpers.sql b/dbt/include/global_project/macros/materializations/snapshots/helpers.sql index f72e71e0..ff42fea4 100644 --- a/dbt/include/global_project/macros/materializations/snapshots/helpers.sql +++ b/dbt/include/global_project/macros/materializations/snapshots/helpers.sql @@ -53,7 +53,7 @@ from {{ target_relation }} where {% if config.get('dbt_valid_to_current') %} - {{ adapter.dispatch('equals', 'dbt')({{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }} + {{ equals({{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }} {% else %} {{ columns.dbt_valid_to }} is null {% endif %} @@ -275,7 +275,7 @@ {% macro unique_key_join_on(unique_key, identifier, from_identifier) %} {% if unique_key | is_list %} {% for key in unique_key %} - {{ adapter.dispatch('equals', 'dbt')({{ identifier }}.dbt_unique_key_{{ loop.index }}, {{ from_identifier }}.dbt_unique_key_{{ loop.index }}) }} + {{ equals({{ identifier }}.dbt_unique_key_{{ loop.index }}, {{ from_identifier }}.dbt_unique_key_{{ loop.index }}) }} {%- if not loop.last %} and {%- endif %} {% endfor %} {% else %} diff --git a/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql b/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql index 2d10d153..cd2cdebd 100644 --- a/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql +++ b/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql @@ -15,7 +15,7 @@ when matched {% if config.get("dbt_valid_to_current") %} - and {{ adapter.dispatch('equals', 'dbt')(DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }} + and {{ equals(DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }} {% else %} and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null diff --git a/dbt/include/global_project/macros/utils/equals.sql b/dbt/include/global_project/macros/utils/equals.sql index 2920b7b0..d63b6cc1 100644 --- a/dbt/include/global_project/macros/utils/equals.sql +++ b/dbt/include/global_project/macros/utils/equals.sql @@ -1,4 +1,4 @@ -{% macro equals(first_date, second_date, datepart) %} +{% macro equals(expr1, expr2) %} {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }} {%- endmacro %} From 8937201a1e81ec8b8776672c9290754aa80dbbec Mon Sep 17 00:00:00 2001 From: Adrian Burus Date: Tue, 17 Dec 2024 20:34:54 +0200 Subject: [PATCH 8/9] Avoid using nested {{ }} --- .../models/incremental/merge.sql | 17 +++++++++++++++-- .../materializations/snapshots/helpers.sql | 18 ++++++++++++++++-- .../snapshots/snapshot_merge.sql | 8 +++++++- 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/dbt/include/global_project/macros/materializations/models/incremental/merge.sql b/dbt/include/global_project/macros/materializations/models/incremental/merge.sql index c5920716..d7e8af70 100644 --- a/dbt/include/global_project/macros/materializations/models/incremental/merge.sql +++ b/dbt/include/global_project/macros/materializations/models/incremental/merge.sql @@ -21,8 +21,14 @@ {% do predicates.append(this_key_match) %} {% endfor %} {% else %} + {% set source_unique_key %} + DBT_INTERNAL_SOURCE.{{ unique_key }} + {% endset %} + {% set target_unique_key %} + DBT_INTERNAL_DEST.{{ unique_key }} + {% endset %} {% set unique_key_match %} - {{ equals(DBT_INTERNAL_SOURCE.{{ unique_key }}, DBT_INTERNAL_DEST.{{ unique_key }}) }} + {{ equals(source_unique_key, target_unique_key) }} {% endset %} {% do predicates.append(unique_key_match) %} {% endif %} @@ -66,7 +72,14 @@ using {{ source }} where ( {% for key in unique_key %} - {{ equals({{ source }}.{{ key }}, {{ target }}.{{ key }}) }} + {% set source_unique_key %} + {{ source }}.{{ key }} + {% endset %} + {% set target_unique_key %} + {{ target }}.{{ key }} + {% endset %} + + {{ equals(source_unique_key, target_unique_key) }} {{ "and " if not loop.last}} {% endfor %} {% if incremental_predicates %} diff --git a/dbt/include/global_project/macros/materializations/snapshots/helpers.sql b/dbt/include/global_project/macros/materializations/snapshots/helpers.sql index ff42fea4..905ab136 100644 --- a/dbt/include/global_project/macros/materializations/snapshots/helpers.sql +++ b/dbt/include/global_project/macros/materializations/snapshots/helpers.sql @@ -53,7 +53,14 @@ from {{ target_relation }} where {% if config.get('dbt_valid_to_current') %} - {{ equals({{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }} + {% set source_unique_key %} + columns.dbt_valid_to + {% endset %} + {% set target_unique_key %} + config.get('dbt_valid_to_current') + {% endset %} + + {{ equals(source_unique_key, target_unique_key) }} {% else %} {{ columns.dbt_valid_to }} is null {% endif %} @@ -275,7 +282,14 @@ {% macro unique_key_join_on(unique_key, identifier, from_identifier) %} {% if unique_key | is_list %} {% for key in unique_key %} - {{ equals({{ identifier }}.dbt_unique_key_{{ loop.index }}, {{ from_identifier }}.dbt_unique_key_{{ loop.index }}) }} + {% set source_unique_key %} + {{ identifier }}.dbt_unique_key_{{ loop.index }} + {% endset %} + {% set target_unique_key %} + {{ from_identifier }}.dbt_unique_key_{{ loop.index }} + {% endset %} + + {{ equals(source_unique_key, target_unique_key) }} {%- if not loop.last %} and {%- endif %} {% endfor %} {% else %} diff --git a/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql b/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql index cd2cdebd..19a67f6b 100644 --- a/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql +++ b/dbt/include/global_project/macros/materializations/snapshots/snapshot_merge.sql @@ -15,7 +15,13 @@ when matched {% if config.get("dbt_valid_to_current") %} - and {{ equals(DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }}, {{ config.get('dbt_valid_to_current') }}) }} + {% set source_unique_key %} + DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} + {% endset %} + {% set target_unique_key %} + {{ config.get('dbt_valid_to_current') }} + {% endset %} + and {{ equals(source_unique_key, target_unique_key) }} {% else %} and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null From 087e64de8eb1283ed0ae842a34169073db17ff7d Mon Sep 17 00:00:00 2001 From: Adrian Burus Date: Wed, 18 Dec 2024 14:18:50 +0200 Subject: [PATCH 9/9] Update test seeds / match counts --- .../incremental/test_incremental_unique_id.py | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_unique_id.py b/dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_unique_id.py index bddf407e..34807062 100644 --- a/dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_unique_id.py +++ b/dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_unique_id.py @@ -240,6 +240,8 @@ select 'NY','New York','Manhattan','2021-04-01' union all select 'PA','Philadelphia','Philadelphia','2021-05-21' +union all +select 'CO','Denver',null,'2021-06-18' """ @@ -265,6 +267,8 @@ select 'NY','New York','Manhattan','2021-04-01' union all select 'PA','Philadelphia','Philadelphia','2021-05-21' +union all +select 'CO','Denver',null,'2021-06-18' """ @@ -288,6 +292,7 @@ NY,Kings,Brooklyn,2021-04-02 NY,New York,Manhattan,2021-04-01 PA,Philadelphia,Philadelphia,2021-05-21 +CO,Denver,,2021-06-18 """ seeds__add_new_rows_sql = """ @@ -439,7 +444,7 @@ def fail_to_build_inc_missing_unique_key_column(self, incremental_model_name): def test__no_unique_keys(self, project): """with no unique keys, seed and model should match""" - expected_fields = self.get_expected_fields(relation="seed", seed_rows=8) + expected_fields = self.get_expected_fields(relation="seed", seed_rows=9) test_case_fields = self.get_test_fields( project, seed="seed", incremental_model="no_unique_key", update_sql_file="add_new_rows" ) @@ -449,7 +454,7 @@ def test__no_unique_keys(self, project): def test__empty_str_unique_key(self, project): """with empty string for unique key, seed and model should match""" - expected_fields = self.get_expected_fields(relation="seed", seed_rows=8) + expected_fields = self.get_expected_fields(relation="seed", seed_rows=9) test_case_fields = self.get_test_fields( project, seed="seed", @@ -462,7 +467,7 @@ def test__one_unique_key(self, project): """with one unique key, model will overwrite existing row""" expected_fields = self.get_expected_fields( - relation="one_str__overwrite", seed_rows=7, opt_model_count=1 + relation="one_str__overwrite", seed_rows=8, opt_model_count=1 ) test_case_fields = self.get_test_fields( project, @@ -487,7 +492,7 @@ def test__bad_unique_key(self, project): def test__empty_unique_key_list(self, project): """with no unique keys, seed and model should match""" - expected_fields = self.get_expected_fields(relation="seed", seed_rows=8) + expected_fields = self.get_expected_fields(relation="seed", seed_rows=9) test_case_fields = self.get_test_fields( project, seed="seed", @@ -500,7 +505,7 @@ def test__unary_unique_key_list(self, project): """with one unique key, model will overwrite existing row""" expected_fields = self.get_expected_fields( - relation="unique_key_list__inplace_overwrite", seed_rows=7, opt_model_count=1 + relation="unique_key_list__inplace_overwrite", seed_rows=8, opt_model_count=1 ) test_case_fields = self.get_test_fields( project, @@ -515,7 +520,7 @@ def test__duplicated_unary_unique_key_list(self, project): """with two of the same unique key, model will overwrite existing row""" expected_fields = self.get_expected_fields( - relation="unique_key_list__inplace_overwrite", seed_rows=7, opt_model_count=1 + relation="unique_key_list__inplace_overwrite", seed_rows=8, opt_model_count=1 ) test_case_fields = self.get_test_fields( project, @@ -530,7 +535,7 @@ def test__trinary_unique_key_list(self, project): """with three unique keys, model will overwrite existing row""" expected_fields = self.get_expected_fields( - relation="unique_key_list__inplace_overwrite", seed_rows=7, opt_model_count=1 + relation="unique_key_list__inplace_overwrite", seed_rows=8, opt_model_count=1 ) test_case_fields = self.get_test_fields( project, @@ -545,7 +550,7 @@ def test__trinary_unique_key_list_no_update(self, project): """even with three unique keys, adding distinct rows to seed does not cause seed and model to diverge""" - expected_fields = self.get_expected_fields(relation="seed", seed_rows=8) + expected_fields = self.get_expected_fields(relation="seed", seed_rows=9) test_case_fields = self.get_test_fields( project, seed="seed",