Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions sqlmesh/dbt/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ModelConfig(BaseModelConfig):
batch_concurrency: t.Optional[int] = None
forward_only: bool = True
disable_restatement: t.Optional[bool] = None
allow_partials: t.Optional[bool] = None
allow_partials: bool = True
physical_version: t.Optional[str] = None
auto_restatement_cron: t.Optional[str] = None
auto_restatement_intervals: t.Optional[int] = None
Expand Down Expand Up @@ -620,11 +620,7 @@ def to_sqlmesh(
model_kwargs["physical_properties"] = physical_properties

allow_partials = model_kwargs.pop("allow_partials", None)
if (
allow_partials is None
and kind.is_materialized
and not kind.is_incremental_by_time_range
):
if allow_partials is None:
# Set allow_partials to True for dbt models to preserve the original semantics.
allow_partials = True

Expand Down
1 change: 1 addition & 0 deletions tests/dbt/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def test_model_to_sqlmesh_fields(dbt_dummy_postgres_config: PostgresConfig):
assert model.dialect == "postgres"
assert model.owner == "Sally"
assert model.tags == ["test", "incremental"]
assert model.allow_partials
kind = t.cast(IncrementalByUniqueKeyKind, model.kind)
assert kind.batch_size == 5
assert kind.lookback == 3
Expand Down