You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(console) fixing formating of numerics into strings - #6270
While debugging we (claude + me) were extremely confused by the discrepancy between number of rows reported for a model by the SQLMesh console log and the actual number of rows.
It (Claude) finally understood that a trivial bug on formatting had transformed 5.01 M rows into 51 M rows.
We switched the formatting to using regexp instead of replace.
Test Plan
Tests added. Another file was modified locally because of the make style but I didn't include it in the PR because it was irrelevant to it.
Checklist
I have run make style and fixed any issues
I have added tests for my changes (if applicable)
All existing tests pass (make fast-test)
My commits are signed off (git commit -s) per the DCO
Thanks a lot to the whole team for such a useful tool !
Summary by CodeRabbit
Bug Fixes
Improved processed-row counts in evaluation summaries. Counts now use singular or plural “row” labels appropriately and display large values with compact suffixes and consistent rounding. Trailing decimal zeros are removed without changing other decimal values, making the summaries clearer and more accurate.
No actionable comments were generated in the recent review.
Walkthrough
The evaluation annotation formatter now removes trailing decimal zeros only at the end of a metric value or before a space. Parameterized tests cover row-count wording and compact formatting from 1 to 2.07 billion.
Changes: Evaluation annotation formatting
Layer / File(s)
Summary
Format and test row metrics sqlmesh/core/console.py, tests/core/test_console.py
The formatter trims trailing decimal zeros only before a space or at the end of the string. Tests cover singular and plural row wording and compact k, M, and G formats.
This change fixes console row-count formatting so that values such as 5.01 million are no longer shown as 51 million. The change is small and tested, and no merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "fix(console) fixing formating of numerics into strings" names the primary change: a fix in console numeric-to-string formatting. The changeset replaces the chained replace calls in create…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
The description explains the problem and the fix. The author reports that a formatting bug turned 5.01 M rows into 51 M rows, and that the formatting moved from replace to a regular expression. The au…
Full details: Title check
Explanation
The title "fix(console) fixing formating of numerics into strings" names the primary change: a fix in console numeric-to-string formatting. The changeset replaces the chained replace calls in _create_evaluation_model_annotation with a regex that removes trailing zero decimals from metric(rows_processed). The title has a typo ("formating") and omits the specific bug (5.01 M rows shown as 51 M), but it is related to the main change. It is not vague.
Full details: Description check
Explanation
The description explains the problem and the fix. The author reports that a formatting bug turned 5.01 M rows into 51 M rows, and that the formatting moved from replace to a regular expression. The author also reports that tests were added, that make style was run, and that the DCO sign-off box is checked. The description follows the required template headings (Description, Test Plan, Checklist). Two parts are thin. The Test Plan says only "Tests added" and does not name the test cases or the row-count values checked. The Description also does not name the function changed, so a reviewer must read the diff to find it.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 55ea1036-bdce-4a05-bfe5-a57fa4c17dce
Commits
Reviewing files that changed from the base of the PR and between ce229ae and 6c34534.
Files selected for processing: 2
sqlmesh/core/console.py
tests/core/test_console.py
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
While debugging we (claude + me) were extremely confused by the discrepancy between number of rows reported for a model by the SQLMesh console log and the actual number of rows.
It (Claude) finally understood that a trivial bug on formatting had transformed 5.01 M rows into 51 M rows.
We switched the formatting to using regexp instead of replace.
Test Plan
Tests added. Another file was modified locally because of the make style but I didn't include it in the PR because it was irrelevant to it.
Checklist
make styleand fixed any issuesmake fast-test)git commit -s) per the DCOThanks a lot to the whole team for such a useful tool !
Summary by CodeRabbit