Skip to content

Commit 0051794

Browse files
committed
Fix: Ignore bigquery partition_by config when the target isn't bigquery
1 parent 454e942 commit 0051794

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sqlmesh/dbt/model.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,9 +517,11 @@ def to_sqlmesh(
517517
raise ConfigError(
518518
f"Failed to parse model '{self.canonical_name(context)}' partition_by field '{p}' in '{self.path}': {e}"
519519
) from e
520-
else:
520+
elif isinstance(self.partition_by, dict) and context.target.dialect == "bigquery":
521521
partitioned_by.append(self._big_query_partition_by_expr(context))
522-
optional_kwargs["partitioned_by"] = partitioned_by
522+
523+
if partitioned_by:
524+
optional_kwargs["partitioned_by"] = partitioned_by
523525

524526
if self.cluster_by:
525527
clustered_by = []

0 commit comments

Comments
 (0)