diff --git a/sqlmesh/dbt/model.py b/sqlmesh/dbt/model.py index 124d900c4b..efad5e790b 100644 --- a/sqlmesh/dbt/model.py +++ b/sqlmesh/dbt/model.py @@ -539,10 +539,11 @@ def to_sqlmesh( optional_kwargs["partitioned_by"] = partitioned_by if self.cluster_by: - if isinstance(kind, ViewKind): + if isinstance(kind, (ViewKind, EmbeddedKind)): logger.warning( - "Ignoring cluster_by config for model '%s'; cluster_by is not supported for views.", + "Ignoring cluster_by config for model '%s'; cluster_by is not supported for %s.", self.name, + "views" if isinstance(kind, ViewKind) else "ephemeral models", ) else: clustered_by = [] diff --git a/tests/dbt/test_transformation.py b/tests/dbt/test_transformation.py index 22b75abab6..29651f9140 100644 --- a/tests/dbt/test_transformation.py +++ b/tests/dbt/test_transformation.py @@ -2074,6 +2074,17 @@ def test_model_cluster_by(): ) assert model.to_sqlmesh(context).clustered_by == [] + model = ModelConfig( + name="model", + alias="model", + package_name="package", + target_schema="test", + cluster_by=["Bar", "qux"], + sql="SELECT * FROM baz", + materialized=Materialization.EPHEMERAL.value, + ) + assert model.to_sqlmesh(context).clustered_by == [] + def test_snowflake_dynamic_table(): context = DbtContext()