Skip to content

Commit a90db9a

Browse files
authored
Fix: pop 'begin' model config for all model kinds (#5453)
1 parent 622fd16 commit a90db9a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sqlmesh/dbt/model.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,9 @@ def to_sqlmesh(
656656
# Set allow_partials to True for dbt models to preserve the original semantics.
657657
allow_partials = True
658658

659+
# pop begin for all models so we don't pass it through for non-incremental materializations
660+
# (happens if model config is microbatch but project config overrides)
661+
begin = model_kwargs.pop("begin", None)
659662
if kind.is_incremental:
660663
if self.batch_size and isinstance(self.batch_size, str):
661664
if "interval_unit" in model_kwargs:
@@ -665,7 +668,7 @@ def to_sqlmesh(
665668
else:
666669
model_kwargs["interval_unit"] = self.batch_size
667670
self.batch_size = None
668-
if begin := model_kwargs.pop("begin", None):
671+
if begin:
669672
if "start" in model_kwargs:
670673
get_console().log_warning(
671674
f"Both 'begin' and 'start' are set for model '{self.canonical_name(context)}'. 'start' will be used."

0 commit comments

Comments
 (0)