Skip to content

Commit 3eb3ccc

Browse files
committed
Fix virtual layer prog bar label
1 parent 708b301 commit 3eb3ccc

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

sqlmesh/core/console.py

+8-12
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,13 @@ def show_linter_violations(
516516
pass
517517

518518

519-
def make_progress_bar(message: str, console: t.Optional[RichConsole] = None) -> Progress:
519+
def make_progress_bar(
520+
message: str,
521+
console: t.Optional[RichConsole] = None,
522+
justify: t.Literal["default", "left", "center", "right", "full"] = "right",
523+
) -> Progress:
520524
return Progress(
521-
TextColumn(f"[bold blue]{message}", justify="right"),
525+
TextColumn(f"[bold blue]{message}", justify=justify),
522526
BarColumn(bar_width=PROGRESS_BAR_WIDTH),
523527
"[progress.percentage]{task.percentage:>3.1f}%",
524528
"•",
@@ -799,16 +803,8 @@ def start_promotion_progress(
799803
) -> None:
800804
"""Indicates that a new snapshot promotion progress has begun."""
801805
if self.promotion_progress is None:
802-
self.promotion_progress = Progress(
803-
TextColumn(
804-
"[bold blue]Updating virtual layer ", # space to align with other progress bars
805-
justify="right",
806-
),
807-
BarColumn(bar_width=PROGRESS_BAR_WIDTH),
808-
"[progress.percentage]{task.percentage:>3.1f}%",
809-
"•",
810-
TimeElapsedColumn(),
811-
console=self.console,
806+
self.promotion_progress = make_progress_bar(
807+
"Updating virtual layer ", self.console, justify="left"
812808
)
813809

814810
self.promotion_progress.start()

0 commit comments

Comments
 (0)