Skip to content

Commit 4f536b2

Browse files
remove no differences from the cli output
1 parent 2ef0ba6 commit 4f536b2

3 files changed

Lines changed: 8 additions & 21 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 the 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: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,9 @@ def stop_table_diff_progress(self, success: bool) -> None:
250250
@abc.abstractmethod
251251
def show_table_diff_details(
252252
self,
253-
models_no_diff: t.List[str],
254253
models_to_diff: t.List[str],
255254
) -> None:
256-
"""Display information about which tables are identical and which are diffed"""
255+
"""Display information about which tables are going to be diffed"""
257256

258257
@abc.abstractmethod
259258
def show_table_diff_summary(self, table_diff: TableDiff) -> None:
@@ -717,7 +716,6 @@ def stop_table_diff_progress(self, success: bool) -> None:
717716

718717
def show_table_diff_details(
719718
self,
720-
models_no_diff: t.List[str],
721719
models_to_diff: t.List[str],
722720
) -> None:
723721
pass
@@ -1983,16 +1981,9 @@ def loading_stop(self, id: uuid.UUID) -> None:
19831981

19841982
def show_table_diff_details(
19851983
self,
1986-
models_no_diff: t.List[str],
19871984
models_to_diff: t.List[str],
19881985
) -> None:
1989-
"""Display information about which tables are identical and which are diffed"""
1990-
1991-
if models_no_diff:
1992-
m_tree = Tree("\n[b]Models without changes:")
1993-
for m in models_no_diff:
1994-
m_tree.add(f"[{self.TABLE_DIFF_SOURCE_BLUE}]{m}[/{self.TABLE_DIFF_SOURCE_BLUE}]")
1995-
self._print(m_tree)
1986+
"""Display information about which tables are going to be diffed"""
19961987

19971988
if models_to_diff:
19981989
m_tree = Tree("\n[b]Models to compare:")

sqlmesh/core/context.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,6 @@ def table_diff(
16251625
models_to_diff: t.List[
16261626
t.Tuple[Model, EngineAdapter, str, str, t.Optional[t.List[str] | exp.Condition]]
16271627
] = []
1628-
models_no_diff: t.List[str] = []
16291628
models_without_grain: t.List[Model] = []
16301629
source_snapshots_to_name = {
16311630
snapshot.name: snapshot for snapshot in source_env.snapshots
@@ -1657,15 +1656,12 @@ def table_diff(
16571656
models_to_diff.append((model, adapter, source, target, model_on))
16581657
if not model_on:
16591658
models_without_grain.append(model)
1660-
else:
1661-
models_no_diff.append(model_fqn)
1662-
1663-
self.console.show_table_diff_details(
1664-
models_no_diff,
1665-
[model[0].name for model in models_to_diff],
1666-
)
16671659

16681660
if models_to_diff:
1661+
self.console.show_table_diff_details(
1662+
[model[0].name for model in models_to_diff],
1663+
)
1664+
16691665
if models_without_grain:
16701666
model_names = "\n".join(
16711667
f"─ {model.name} \n at '{model._path}'" for model in models_without_grain

0 commit comments

Comments
 (0)