Skip to content

Commit 6a817e9

Browse files
committed
cosmetics
1 parent 254c8fb commit 6a817e9

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

sqlmesh/core/console.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2270,7 +2270,6 @@ def log_models_updated_during_restatement(
22702270
dialect=self.dialect,
22712271
)
22722272
current_branch = tree.add(display_name)
2273-
restated_snapshot.table_name()
22742273
current_branch.add(f"restated version: '{restated_snapshot.version}'")
22752274
current_branch.add(f"currently active version: '{updated_snapshot.version}'")
22762275

sqlmesh/core/plan/evaluator.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,11 @@ def visit_audit_only_run_stage(
284284
def visit_restatement_stage(
285285
self, stage: stages.RestatementStage, plan: EvaluatablePlan
286286
) -> None:
287-
# Restating intervals on prod plans means that once the data for the intervals being restated has been refreshed
287+
# Restating intervals on prod plans means that once the data for the intervals being restated has been backfilled
288288
# (which happens in the backfill stage) then we need to clear those intervals *from state* across all other environments.
289289
#
290-
# This ensures that work done in dev environments can still be promoted to prod
291-
# by forcing dev environments to re-run intervals that changed in prod (because after this stage runs they show as missing)
290+
# This ensures that work done in dev environments can still be promoted to prod by forcing dev environments to
291+
# re-run intervals that changed in prod (because after this stage runs they are cleared from state and thus show as missing)
292292
#
293293
# It also means that any new dev environments created while this restatement plan was running also get the
294294
# correct intervals cleared because we look up matching snapshots as at right now and not as at the time the plan
@@ -313,8 +313,8 @@ def visit_restatement_stage(
313313
remove_shared_versions=plan.is_prod,
314314
)
315315

316-
# While the restatements were being processed, did any of the snapshots
317-
# being restated get new versions deployed? If they did, they will not reflect the data that just got restated
316+
# While the restatements were being processed, did any of the snapshots being restated get new versions deployed?
317+
# If they did, they will not reflect the data that just got restated, so we need to notify the user
318318
if deployed_env := self.state_sync.get_environment(plan.environment.name):
319319
promoted_snapshots_by_name = {s.name: s for s in deployed_env.snapshots}
320320

sqlmesh/core/plan/stages.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
from dataclasses import dataclass
44
from sqlmesh.core import constants as c
55
from sqlmesh.core.environment import EnvironmentStatements, EnvironmentNamingInfo, Environment
6-
from sqlmesh.core.plan.common import (
7-
should_force_rebuild,
8-
)
6+
from sqlmesh.core.plan.common import should_force_rebuild
97
from sqlmesh.core.plan.definition import EvaluatablePlan
108
from sqlmesh.core.state_sync import StateReader
119
from sqlmesh.core.scheduler import merged_missing_intervals, SnapshotToIntervals
@@ -103,9 +101,9 @@ class RestatementStage:
103101
104102
This stage is effectively a "marker" stage to trigger the plan evaluator to perform the "clear intervals" logic after the BackfillStage has completed.
105103
The "clear intervals" logic is executed just-in-time using the latest state available in order to pick up new snapshots that may have
106-
been created while the BackfillState was running, which is why we do not build a list of snapshots to clear at plan time.
104+
been created while the BackfillStage was running, which is why we do not build a list of snapshots to clear at plan time and defer to evaluation time.
107105
108-
Note that this stage is only present on `prod` plans, because dev plans do not need to worry about clearing intervals in other environments.
106+
Note that this stage is only present on `prod` plans because dev plans do not need to worry about clearing intervals in other environments.
109107
110108
Args:
111109
all_snapshots: All snapshots in the plan by name. Note that this does not include the snapshots from other environments that will get their

0 commit comments

Comments
 (0)