Skip to content

Commit 966ad93

Browse files
revise logic so that info is provided for small number of models
1 parent 283606f commit 966ad93

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

docs/guides/tablediff.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ sqlmesh table_diff prod:dev --select-model "sqlmesh_example.*"
135135

136136
When diffing multiple models, SQLMesh will:
137137

138-
1. Show the models returned by the selector that exist in both environments, but have no differences
139-
2. Compare the models that have differences and display the data diff of each model
138+
1. Show the models returned by the selector that exist in both environments and have differences
139+
2. Compare these models and display the data diff of each model
140140

141141
> Note: Models will only be data diffed if there's a breaking change that impacts them.
142142

sqlmesh/core/console.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ class Console(
318318
with them when their input is needed."""
319319

320320
INDIRECTLY_MODIFIED_DISPLAY_THRESHOLD = 10
321+
TABLE_DIFF_MODELS_DISPLAY_THRESHOLD = 5
321322

322323
@abc.abstractmethod
323324
def start_plan_evaluation(self, plan: EvaluatablePlan) -> None:
@@ -1988,7 +1989,10 @@ def show_table_diff_details(
19881989
) -> None:
19891990
"""Display information about which tables are identical and which are diffed"""
19901991

1991-
if models_no_diff:
1992+
if (
1993+
len(models_no_diff) < self.TABLE_DIFF_MODELS_DISPLAY_THRESHOLD
1994+
or self.verbosity == Verbosity.VERY_VERBOSE
1995+
):
19921996
m_tree = Tree("\n[b]Models without changes:")
19931997
for m in models_no_diff:
19941998
m_tree.add(f"[{self.TABLE_DIFF_SOURCE_BLUE}]{m}[/{self.TABLE_DIFF_SOURCE_BLUE}]")

0 commit comments

Comments
 (0)