Skip to content

Commit e13f1cb

Browse files
committed
modify test about materialized_properteis
Signed-off-by: jaogoy <jaogoy@gmail.com>
1 parent 0390776 commit e13f1cb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

sqlmesh/core/snapshot/evaluator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2724,11 +2724,13 @@ def insert(
27242724

27252725
logger.info("Replacing view '%s'", table_name)
27262726
materialized_properties = None
2727-
if is_materialized_view:
2727+
if is_materialized_view and (
2728+
model.partitioned_by or model.partition_interval_unit or model.clustered_by
2729+
):
27282730
materialized_properties = {
27292731
"partitioned_by": model.partitioned_by,
2730-
"clustered_by": model.clustered_by,
27312732
"partition_interval_unit": model.partition_interval_unit,
2733+
"clustered_by": model.clustered_by,
27322734
}
27332735
self.adapter.create_view(
27342736
table_name,

tests/core/test_snapshot_evaluator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,7 @@ def test_evaluate_materialized_view_with_execution_time_macro(
782782
view_properties={},
783783
table_description=None,
784784
column_descriptions={},
785+
materialized_properties=None,
785786
)
786787

787788

0 commit comments

Comments
 (0)