Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: improve CLI evaluation progress bar #4000

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open

Conversation

treysp
Copy link
Contributor

@treysp treysp commented Mar 14, 2025

This PR updates the CLI plan model evaluation progress bar output and modifies all progress bar labels.

Evaluation progress bar

The evaluation progress bar prints one line of output for each executed batch.

Currently, it includes the node's batch number, node's name, and batch run time:
[3/7] sushi.customer_revenue_lifetime evaluated in 0.02s

The new output includes more information for each batch and is vertically aligned across batches. The column widths are static and specified in the code. If a model's information string is longer than the column width, the information is truncated with 3 dots (dots on left for node names so you see table, right for annotation so you see SQLMesh action).

This annotated screenshot below shows evaluation progress bar output from a modified version of the sushi project. The output includes an annotation of what SQLMesh did for each node:

  1. raw.demographics is an external model, and SQLMesh ran its audits
  2. sushi.added_model is an hourly incremental by time model processing an interval <24h, so its interval start/end times are displayed
  3. sushi.raw_marketing is a full model, so SQLMesh fully refreshed the table
  4. sushi.waiter_names is a seed model, so SQLMesh inserted from file
  5. assert_item_price_above_zero is a standalone audit, which SQLMesh ran
  6. sushi.top_waiters is a view, so SQLMesh recreated the view
  7. If a model has audits, we display the number that passed with a check mark
  8. If a model has failed non-blocking audits, we issue a warning and display the number that failed with a red X

Untitled

Model kind annotations not in screenshot:

  • INCREMENTAL_BY_UNIQUE_KEY: [insert or update rows]
  • INCREMENTAL_BY_PARTITION: [insert partition]

All other model kinds display the processed interval start/ends, including time if the interval is <24h long.

Progress bar language

  • Creation progress bar
    • Bar label: Creating physical tables --> Updating physical layer
    • Completion message: Model versions created successfully --> ✔ Physical layer updated
  • Evaluation progress bar
    • Bar label: Evaluating models --> Executing model batches
    • Completion message: Model batches executed successfully --> ✔ Model batches executed
  • Promotion progress bar
    • Bar label: Virtually Updating 'prod' --> Updating virtual layer
    • Completion message: Target environment updated successfully --> ✔ Virtual layer updated

Default catalog in display names

Currently, we only display a model's catalog if it was explicitly specified (and not if SQLMesh used the default catalog).

This PR updates very verbose mode (sqlmesh plan -vv) to include default catalog in all model names.

Screenshot 2025-03-27 at 6 02 38 PM

@treysp treysp force-pushed the trey/eval-prog-bar branch 2 times, most recently from 1119862 to e76ebb8 Compare March 14, 2025 19:35
@treysp treysp force-pushed the trey/eval-prog-bar branch from fddbf4d to b5779b0 Compare March 14, 2025 21:36
@treysp treysp force-pushed the trey/eval-prog-bar branch 12 times, most recently from cf879e3 to f9310ad Compare March 27, 2025 22:12
Copy link
Member

@izeigerman izeigerman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider my suggestions. Looks good otherwise

@treysp treysp force-pushed the trey/eval-prog-bar branch 2 times, most recently from 82c06ff to 9b26ec2 Compare March 28, 2025 15:23
@treysp treysp force-pushed the trey/eval-prog-bar branch 2 times, most recently from 3eb3ccc to 708b301 Compare March 28, 2025 21:18
@treysp treysp force-pushed the trey/eval-prog-bar branch from 708b301 to ec659e4 Compare March 28, 2025 21:35
@treysp treysp marked this pull request as ready for review March 28, 2025 21:53
@treysp treysp force-pushed the trey/eval-prog-bar branch from 4b0420b to 0cff15f Compare March 28, 2025 22:02
@treysp treysp requested a review from sungchun12 March 28, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants