From f37b4cd834b92d20cea5606415d24f7150295aa1 Mon Sep 17 00:00:00 2001 From: Michelle Ark Date: Mon, 23 Sep 2024 22:56:43 +0100 Subject: [PATCH] Add required 'begin' config for testing microbatch models (#314) --- .changes/unreleased/Under the Hood-20240923-184719.yaml | 7 +++++++ .../adapter/incremental/test_incremental_microbatch.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Under the Hood-20240923-184719.yaml diff --git a/.changes/unreleased/Under the Hood-20240923-184719.yaml b/.changes/unreleased/Under the Hood-20240923-184719.yaml new file mode 100644 index 00000000..35e66b90 --- /dev/null +++ b/.changes/unreleased/Under the Hood-20240923-184719.yaml @@ -0,0 +1,7 @@ +kind: Under the Hood +body: 'dbt-tests-adapters: Add required begin to microbatch model config to BaseMicrobatch + test' +time: 2024-09-23T18:47:19.171618+01:00 +custom: + Author: michelleark + Issue: "315" diff --git a/dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_microbatch.py b/dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_microbatch.py index 62c21c55..5bbabbe1 100644 --- a/dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_microbatch.py +++ b/dbt-tests-adapter/dbt/tests/adapter/incremental/test_incremental_microbatch.py @@ -22,7 +22,7 @@ """ _microbatch_model_sql = """ -{{ config(materialized='incremental', incremental_strategy='microbatch', unique_key='id', event_time='event_time', batch_size='day') }} +{{ config(materialized='incremental', incremental_strategy='microbatch', unique_key='id', event_time='event_time', batch_size='day', begin=modules.datetime.datetime(2020, 1, 1, 0, 0, 0)) }} select * from {{ ref('input_model') }} """