@@ -107,10 +107,11 @@ def evaluate(
107107 steps .append (AuditOnlyRunStep (snapshots = list (audit_only_snapshots .values ())))
108108
109109 if plan .restatements and not plan .is_dev :
110- snapshot_intervals_to_restate = {
111- snapshots_by_name [name ].table_info : intervals
112- for name , intervals in plan .restatements .items ()
113- }
110+ snapshot_intervals_to_restate = {}
111+ for name , interval in plan .restatements .items ():
112+ restated_snapshot = snapshots_by_name [name ]
113+ restated_snapshot .remove_interval (interval )
114+ snapshot_intervals_to_restate [restated_snapshot .table_info ] = interval
114115 steps .append (RestatementStep (snapshot_intervals = snapshot_intervals_to_restate ))
115116
116117 if before_promote_snapshots and not plan .empty_backfill and not plan .skip_backfill :
@@ -393,12 +394,21 @@ def visit_backfill_step(self, step: BackfillStep) -> Tree:
393394 model_tree .add ("Run pre-statements" )
394395
395396 if snapshot .is_incremental :
396- formatted_range = SnapshotIntervals (
397- snapshot_id = snapshot .snapshot_id , intervals = intervals
398- ).format_intervals (snapshot .node .interval_unit )
399- model_tree .add (
400- f"Incrementally insert records within the range [{ formatted_range } ]"
397+ current_intervals = (
398+ snapshot .intervals
399+ if step .deployability_index .is_deployable (snapshot )
400+ else snapshot .dev_intervals
401401 )
402+ if current_intervals :
403+ formatted_range = SnapshotIntervals (
404+ snapshot_id = snapshot .snapshot_id , intervals = intervals
405+ ).format_intervals (snapshot .node .interval_unit )
406+ model_tree .add (
407+ f"Incrementally insert records within the range [{ formatted_range } ]"
408+ )
409+ else :
410+ # If there are no intervals, the table will be fully refreshed
411+ model_tree .add ("Fully refresh table" )
402412 elif snapshot .is_view :
403413 model_tree .add ("Recreate view" )
404414 else :
0 commit comments