From ead26fff1ab2704200fde5456a9a18815e830ba2 Mon Sep 17 00:00:00 2001 From: Quigley Malcolm Date: Mon, 21 Oct 2024 13:10:00 -0700 Subject: [PATCH] Update microbatch tests to handle update wherein incremental strategies are always validated (#10884) dbt-adapters updated the incremental_strategy validation of incremental models such that the validation now _always_ happens when an incremental model is executed. A test in dbt-core `TestMicrobatchCustomUserStrategyEnvVarTrueInvalid` was previously set to _expect_ buggy behavior where an incremental model would succeed on it's "first"/"refresh" run even if it had an invalid incremental strategy. Thus we needed to update this test in dbt-core to expect the now correct behavior of incremental model execution time validation --- tests/functional/microbatch/test_microbatch.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/functional/microbatch/test_microbatch.py b/tests/functional/microbatch/test_microbatch.py index 8bbf274554d..02c6976c848 100644 --- a/tests/functional/microbatch/test_microbatch.py +++ b/tests/functional/microbatch/test_microbatch.py @@ -162,11 +162,8 @@ def test_use_custom_microbatch_strategy_env_var_true_invalid_incremental_strateg with mock.patch.object( type(project.adapter), "valid_incremental_strategies", lambda _: [] ): - # Initial run - with patch_microbatch_end_time("2020-01-03 13:57:00"): - run_dbt(["run"], expect_pass=False) - - # Incremental run fails + # Run of microbatch model while adapter doesn't have a "valid" + # microbatch strategy causes an error to be raised with patch_microbatch_end_time("2020-01-03 13:57:00"): _, logs = run_dbt_and_capture(["run"], expect_pass=False) assert "'microbatch' is not valid" in logs