Skip to content

Commit 4da307a

Browse files
authored
Fix: do not display signal progress if a project has no signals (#4939)
1 parent 537a311 commit 4da307a

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

sqlmesh/core/console.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,7 @@ def __init__(
912912
self.table_diff_model_tasks: t.Dict[str, TaskID] = {}
913913
self.table_diff_progress_live: t.Optional[Live] = None
914914

915+
self.signal_progress_logged = False
915916
self.signal_status_tree: t.Optional[Tree] = None
916917

917918
self.verbosity = verbosity
@@ -956,7 +957,8 @@ def start_evaluation_progress(
956957
) -> None:
957958
"""Indicates that a new snapshot evaluation/auditing progress has begun."""
958959
# Add a newline to separate signal checking from evaluation
959-
self._print("")
960+
if self.signal_progress_logged:
961+
self._print("")
960962

961963
if not self.evaluation_progress_live:
962964
self.evaluation_total_progress = make_progress_bar(
@@ -1188,6 +1190,7 @@ def stop_signal_progress(self) -> None:
11881190
if self.signal_status_tree is not None:
11891191
self._print(self.signal_status_tree)
11901192
self.signal_status_tree = None
1193+
self.signal_progress_logged = True
11911194

11921195
def start_creation_progress(
11931196
self,

sqlmesh/core/scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ def _check_ready_intervals(
754754
"""
755755
signals = snapshot.is_model and snapshot.model.render_signal_calls()
756756

757-
if not signals:
757+
if not (signals and signals.signals_to_kwargs):
758758
return intervals
759759

760760
self.console.start_signal_progress(

tests/cli/test_cli.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2175,3 +2175,18 @@ def none_ready(batch):
21752175

21762176
# Only one model was executed
21772177
assert "100.0% • 1/1 • 0:00:00" in result.output
2178+
2179+
rmtree(tmp_path)
2180+
tmp_path.mkdir(parents=True, exist_ok=True)
2181+
2182+
create_example_project(tmp_path)
2183+
2184+
# Example project models have start dates, so there are no date prompts
2185+
# for the `prod` environment.
2186+
# Input: `y` to apply and backfill
2187+
result = runner.invoke(
2188+
cli, ["--log-file-dir", str(tmp_path), "--paths", str(tmp_path), "plan"], input="y\n"
2189+
)
2190+
assert_plan_success(result)
2191+
2192+
assert "Checking signals" not in result.output

0 commit comments

Comments
 (0)