Skip to content

Commit ef04ff7

Browse files
committed
Align virtual prog bar labels
1 parent 6f09f8d commit ef04ff7

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

sqlmesh/core/console.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,9 @@ def update_promotion_progress(self, snapshot: SnapshotInfoLike, promoted: bool)
820820
"""Update the snapshot promotion progress."""
821821
if self.promotion_progress is not None and self.promotion_task is not None:
822822
if self.verbosity >= Verbosity.VERBOSE:
823-
action_str = "[green]promoted[/green]" if promoted else "[yellow]demoted[/yellow]"
823+
action_str = (
824+
"[green]promoted[/green]" if promoted else "[yellow]demoted[/yellow]"
825+
).ljust(len("promoted"))
824826
self.promotion_progress.live.console.print(
825827
f"{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}"
826828
)
@@ -2795,7 +2797,7 @@ def _create_evaluation_model_annotation(snapshot: Snapshot, interval_info: t.Opt
27952797
if snapshot.is_model and snapshot.model.kind.is_external:
27962798
return "run external audits"
27972799
if snapshot.model.kind.is_seed:
2798-
return "insert from seed file"
2800+
return "insert seed file"
27992801
if snapshot.model.kind.is_full:
28002802
return "full refresh"
28012803
if snapshot.model.kind.is_view:

tests/cli/test_cli.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,8 @@ def test_plan_verbose(runner, tmp_path):
293293
cli, ["--log-file-dir", tmp_path, "--paths", tmp_path, "plan", "--verbose"], input="y\n"
294294
)
295295
assert_plan_success(result)
296-
assert "sqlmesh_example.seed_model created" in result.output
297-
assert "sqlmesh_example.seed_model promoted" in result.output
296+
assert "sqlmesh_example.seed_model created" in result.output
297+
assert "sqlmesh_example.seed_model promoted" in result.output
298298

299299

300300
def test_plan_very_verbose(runner, tmp_path, copy_to_temp_path):
@@ -552,7 +552,7 @@ def test_plan_nonbreaking(runner, tmp_path):
552552
assert "+ 'a' AS new_col" in result.output
553553
assert "Directly Modified: sqlmesh_example.incremental_model (Non-breaking)" in result.output
554554
assert "sqlmesh_example.full_model (Indirect Non-breaking)" in result.output
555-
assert "sqlmesh_example.incremental_model [insert" in result.output
555+
assert "sqlmesh_example.incremental_model [insert" in result.output
556556
assert "sqlmesh_example.full_model evaluated [full refresh" not in result.output
557557
assert_backfill_success(result)
558558

@@ -649,8 +649,8 @@ def test_plan_dev_select(runner, tmp_path):
649649
assert "+ item_id + 1 AS item_id," not in result.output
650650
assert "Directly Modified: sqlmesh_example__dev.full_model (Breaking)" not in result.output
651651
# only incremental_model backfilled
652-
assert "sqlmesh_example__dev.incremental_model [insert" in result.output
653-
assert "sqlmesh_example__dev.full_model [full refresh" not in result.output
652+
assert "sqlmesh_example__dev.incremental_model [insert" in result.output
653+
assert "sqlmesh_example__dev.full_model [full refresh" not in result.output
654654
assert_backfill_success(result)
655655

656656

@@ -688,8 +688,8 @@ def test_plan_dev_backfill(runner, tmp_path):
688688
"Directly Modified: sqlmesh_example__dev.incremental_model (Non-breaking)" in result.output
689689
)
690690
# only incremental_model backfilled
691-
assert "sqlmesh_example__dev.incremental_model [insert" in result.output
692-
assert "sqlmesh_example__dev.full_model [full refresh" not in result.output
691+
assert "sqlmesh_example__dev.incremental_model [insert" in result.output
692+
assert "sqlmesh_example__dev.full_model [full refresh" not in result.output
693693
assert_backfill_success(result)
694694

695695

0 commit comments

Comments
 (0)