File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -510,10 +510,11 @@ def to_sqlmesh(
510510 physical_properties : t .Dict [str , t .Any ] = {}
511511
512512 if self .partition_by :
513- if isinstance (kind , ViewKind ):
513+ if isinstance (kind , ( ViewKind , EmbeddedKind ) ):
514514 logger .warning (
515- "Ignoring partition_by config for model '%s'; partition_by is not supported for views ." ,
515+ "Ignoring partition_by config for model '%s'; partition_by is not supported for %s ." ,
516516 self .name ,
517+ "views" if isinstance (kind , ViewKind ) else "ephemeral models" ,
517518 )
518519 else :
519520 partitioned_by = []
Original file line number Diff line number Diff line change @@ -1728,6 +1728,18 @@ def test_partition_by(sushi_test_project: Project):
17281728 )
17291729 assert model_config .to_sqlmesh (context ).partitioned_by == []
17301730
1731+ model_config = ModelConfig (
1732+ name = "model" ,
1733+ alias = "model" ,
1734+ schema = "test" ,
1735+ package_name = "package" ,
1736+ materialized = Materialization .EPHEMERAL .value ,
1737+ unique_key = "ds" ,
1738+ partition_by = {"field" : "ds" , "granularity" : "month" },
1739+ sql = """SELECT 1 AS one, ds FROM foo""" ,
1740+ )
1741+ assert model_config .to_sqlmesh (context ).partitioned_by == []
1742+
17311743
17321744@pytest .mark .xdist_group ("dbt_manifest" )
17331745def test_partition_by_none (sushi_test_project : Project ):
You can’t perform that action at this time.
0 commit comments