Skip to content

Commit a4baca7

Browse files
author
Tomasz Zórawik
committed
add comments
1 parent fb559d2 commit a4baca7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

sqlmesh/core/plan/builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -683,8 +683,8 @@ def _categorize_snapshot(
683683
if snapshot.is_materialized_view and not forward_only:
684684
# We categorize changes as breaking to allow for instantaneous switches in a virtual layer.
685685
# Otherwise, there might be a potentially long downtime during MVs recreation.
686-
# In the case of forward-only changes this optimization is not applicable because we continue using the
687-
# same (existing) table version.
686+
# In the case of forward-only changes this optimization is not applicable because we want to continue
687+
# using the same (existing) table version.
688688
snapshot.categorize_as(SnapshotChangeCategory.INDIRECT_BREAKING, forward_only)
689689
return
690690

tests/core/test_plan.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4239,4 +4239,6 @@ def test_forward_only_indirect_change_to_materialized_view(make_snapshot):
42394239

42404240
PlanBuilder(context_diff, forward_only=True).build()
42414241

4242+
# Forward-only indirect changes to MVs should not always be classified as indirect breaking.
4243+
# Instead, we want to preserve the standard categorization.
42424244
assert snapshot_b_new.change_category == SnapshotChangeCategory.INDIRECT_NON_BREAKING

0 commit comments

Comments
 (0)