Skip to content

Commit 52880c7

Browse files
committed
refactor: trim the plan_builder execution-time comment
Shorten the inline comment to the rationale (an explicit execution time is the effective now; raise the per-model caps so plan matches plan --run) and drop the hard-coded builder.py line reference that would drift. No behavior change. Signed-off-by: wtruongdata <quang072000@gmail.com>
1 parent 7376ec2 commit 52880c7

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

‎sqlmesh/core/context.py‎

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,21 +1728,11 @@ def plan_builder(
17281728
and default_end is not None
17291729
and execution_time_ts > default_end
17301730
):
1731-
# An explicitly provided execution time acts as the plan's effective "now", so the
1732-
# default end is allowed to extend past the recorded prod frontier instead of being
1733-
# capped by it. This mirrors how an explicit `end` causes the per-model interval end
1734-
# caps to be dropped entirely in PlanBuilder.build() (see `self.override_end`,
1735-
# sqlmesh/core/plan/builder.py line 206). Raising (rather than dropping) the caps is
1736-
# safe here because `plan --run` already runs with no caps at all.
1737-
#
1738-
# Note this raises every entry already present in max_interval_end_per_model (i.e.
1739-
# every model in this dict, which _get_max_interval_end_per_model above has already
1740-
# scoped down to backfill_models/its ancestors when a selection is in effect) - not
1741-
# just modified or explicitly selected models within that scope. That's intentional,
1742-
# not an oversight. It's what makes a plain, unscoped `sqlmesh plan --execution-time X`
1743-
# in prod report the same missing intervals as `sqlmesh plan --run --execution-time X`
1744-
# would at the same simulated time. Narrowing this further would reintroduce a `plan`
1745-
# vs `plan --run` mismatch for models within that scope.
1731+
# An explicit execution time is the plan's effective "now", so the default end may
1732+
# extend past the recorded prod frontier (as an explicit `end` already does via
1733+
# PlanBuilder.override_end). Raising every per-model cap to it keeps a plain
1734+
# `plan --execution-time X` in step with `plan --run --execution-time X`, which
1735+
# already runs with no caps.
17461736
default_end = execution_time_ts
17471737
execution_time_dt = to_datetime(execution_time_ts)
17481738
max_interval_end_per_model = {

0 commit comments

Comments
 (0)