Skip to content

Commit 1a7428e

Browse files
committed
Tidy up
1 parent f9868aa commit 1a7428e

4 files changed

Lines changed: 20 additions & 21 deletions

File tree

sqlmesh/core/console.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ def start_evaluation_progress(
620620
self.evaluation_progress_live.start()
621621

622622
self.evaluation_total_task = self.evaluation_total_progress.add_task(
623-
"Evaluating models...", total=sum(batch_sizes.values())
623+
"Executing models...", total=sum(batch_sizes.values())
624624
)
625625

626626
self.evaluation_model_batch_sizes = batch_sizes
@@ -825,7 +825,7 @@ def update_promotion_progress(self, snapshot: SnapshotInfoLike, promoted: bool)
825825
if self.promotion_progress is not None and self.promotion_task is not None:
826826
if self.verbosity >= Verbosity.VERBOSE:
827827
check_mark = f"{GREEN_CHECK_MARK} " if promoted else " "
828-
action_str = "[green]updated[/green]" if promoted else "[yellow]demoted[/yellow]"
828+
action_str = "[green]promoted[/green]" if promoted else "[yellow]demoted[/yellow]"
829829
self.promotion_progress.live.console.print(
830830
f"{check_mark}{snapshot.display_name(self.environment_naming_info, self.default_catalog if self.verbosity < Verbosity.VERY_VERBOSE else None, dialect=self.dialect).ljust(self.PROGRESS_BAR_COLUMN_WIDTHS['name'])} {action_str}"
831831
)
@@ -2628,8 +2628,7 @@ def show_row_diff(
26282628
self._write(row_diff)
26292629

26302630

2631-
# _CONSOLE: Console = NoopConsole()
2632-
_CONSOLE: Console = TerminalConsole()
2631+
_CONSOLE: Console = NoopConsole()
26332632

26342633

26352634
def set_console(console: Console) -> None:

sqlmesh/core/scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ def evaluate_node(node: SchedulingUnit) -> None:
478478
try:
479479
assert execution_time # mypy
480480
assert deployability_index # mypy
481-
audit_results = []
481+
audit_results = [] # so it exists for finally if `evaluate` raises
482482
audit_results = self.evaluate(
483483
snapshot=snapshot,
484484
start=start,

tests/cli/test_cli.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -128,22 +128,22 @@ def assert_new_env(result, new_env="prod", from_env="prod", initialize=True) ->
128128
) in result.output
129129

130130

131-
def assert_model_versions_created(result) -> None:
131+
def assert_physical_layer_updated(result) -> None:
132132
assert "Physical layer updated" in result.output
133133

134134

135-
def assert_model_batches_evaluated(result) -> None:
135+
def assert_model_batches_executed(result) -> None:
136136
assert "Model batches executed" in result.output
137137

138138

139-
def assert_env_views_updated(result) -> None:
139+
def assert_virtual_layer_updated(result) -> None:
140140
assert "Virtual layer updated" in result.output
141141

142142

143143
def assert_backfill_success(result) -> None:
144-
assert_model_versions_created(result)
145-
assert_model_batches_evaluated(result)
146-
assert_env_views_updated(result)
144+
assert_physical_layer_updated(result)
145+
assert_model_batches_executed(result)
146+
assert_virtual_layer_updated(result)
147147

148148

149149
def assert_plan_success(result, new_env="prod", from_env="prod") -> None:
@@ -243,8 +243,8 @@ def test_plan_restate_model(runner, tmp_path):
243243
assert_duckdb_test(result)
244244
assert "No changes to plan: project files match the `prod` environment" in result.output
245245
assert "sqlmesh_example.full_model [full refresh" in result.output
246-
assert_model_batches_evaluated(result)
247-
assert_env_views_updated(result)
246+
assert_model_batches_executed(result)
247+
assert_virtual_layer_updated(result)
248248

249249

250250
@pytest.mark.parametrize("flag", ["--skip-backfill", "--dry-run"])
@@ -396,7 +396,7 @@ def test_plan_dev_create_from_virtual(runner, tmp_path):
396396
)
397397
assert result.exit_code == 0
398398
assert_new_env(result, "dev2", "dev", initialize=False)
399-
assert_env_views_updated(result)
399+
assert_virtual_layer_updated(result)
400400
assert_virtual_update(result)
401401

402402

@@ -533,7 +533,7 @@ def test_plan_dev_no_changes(runner, tmp_path):
533533
)
534534
assert result.exit_code == 0
535535
assert_new_env(result, "dev", initialize=False)
536-
assert_env_views_updated(result)
536+
assert_virtual_layer_updated(result)
537537
assert_virtual_update(result)
538538

539539

@@ -718,7 +718,7 @@ def test_run_dev(runner, tmp_path, flag):
718718
# Confirm backfill occurs when we run non-backfilled dev env
719719
result = runner.invoke(cli, ["--log-file-dir", tmp_path, "--paths", tmp_path, "run", "dev"])
720720
assert result.exit_code == 0
721-
assert_model_batches_evaluated(result)
721+
assert_model_batches_executed(result)
722722

723723

724724
@time_machine.travel(FREEZE_TIME)
@@ -750,7 +750,7 @@ def test_run_cron_elapsed(runner, tmp_path):
750750
result = runner.invoke(cli, ["--log-file-dir", tmp_path, "--paths", tmp_path, "run"])
751751

752752
assert result.exit_code == 0
753-
assert_model_batches_evaluated(result)
753+
assert_model_batches_executed(result)
754754

755755

756756
def test_clean(runner, tmp_path):

web/server/console.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def stop_restate_progress(self, success: bool) -> None:
9191

9292
def start_evaluation_progress(
9393
self,
94-
batched_intervals: t.Dict[Snapshot, int],
94+
batch_sizes: t.Dict[Snapshot, int],
9595
environment_naming_info: EnvironmentNamingInfo,
9696
default_catalog: t.Optional[str],
9797
) -> None:
@@ -104,7 +104,7 @@ def start_evaluation_progress(
104104
name=snapshot.name,
105105
view_name=snapshot.display_name(environment_naming_info, default_catalog),
106106
)
107-
for snapshot, total_tasks in batched_intervals.items()
107+
for snapshot, total_tasks in batch_sizes.items()
108108
}
109109
self.plan_apply_stage_tracker.add_stage(
110110
models.PlanStage.backfill,
@@ -128,8 +128,8 @@ def update_snapshot_evaluation_progress(
128128
interval: Interval,
129129
batch_idx: int,
130130
duration_ms: t.Optional[int],
131-
audits_passed: int,
132-
audits_failed: int,
131+
num_audits_passed: int,
132+
num_audits_failed: int,
133133
) -> None:
134134
if self.plan_apply_stage_tracker and self.plan_apply_stage_tracker.backfill:
135135
task = self.plan_apply_stage_tracker.backfill.tasks[snapshot.name]

0 commit comments

Comments
 (0)