Skip to content

Commit 457c361

Browse files
authored
[Refactor] use new model.batch context vars (#1258)
1 parent 86cf6e6 commit 457c361

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Under the Hood
2+
body: Use new `batch` context variables over `node.config.__dbt_internal` ones
3+
time: 2024-12-05T14:40:36.373637-05:00
4+
custom:
5+
Author: michelleark
6+
Issue: "1263"

dbt/include/snowflake/macros/materializations/merge.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@
5757
{%- set incremental_predicates = [] if arg_dict.get('incremental_predicates') is none else arg_dict.get('incremental_predicates') -%}
5858

5959
{#-- Add additional incremental_predicates to filter for batch --#}
60-
{% if model.config.get("__dbt_internal_microbatch_event_time_start") -%}
60+
{% if model.batch and model.batch.event_time_start -%}
6161
{% do incremental_predicates.append("DBT_INTERNAL_TARGET." ~ model.config.event_time ~ " >= to_timestamp_tz('" ~ model.config.__dbt_internal_microbatch_event_time_start ~ "')") %}
6262
{% endif %}
63-
{% if model.config.__dbt_internal_microbatch_event_time_end -%}
63+
{% if model.batch and model.batch.event_time_end -%}
6464
{% do incremental_predicates.append("DBT_INTERNAL_TARGET." ~ model.config.event_time ~ " < to_timestamp_tz('" ~ model.config.__dbt_internal_microbatch_event_time_end ~ "')") %}
6565
{% endif %}
6666
{% do arg_dict.update({'incremental_predicates': incremental_predicates}) %}

0 commit comments

Comments
 (0)