Skip to content

Commit 0a8d0f5

Browse files
add similar message when no models contain differences
1 parent d9d44f4 commit 0a8d0f5

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

sqlmesh/core/context.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,11 +1611,10 @@ def table_diff(
16111611
raise SQLMeshError(f"Could not find environment '{source}'")
16121612
if not target_env:
16131613
raise SQLMeshError(f"Could not find environment '{target}'")
1614-
1614+
criteria = ", ".join(f"'{c}'" for c in select_models)
16151615
try:
16161616
selected_models = self._new_selector().expand_model_selections(select_models)
16171617
if not selected_models:
1618-
criteria = ", ".join(f"'{c}'" for c in select_models)
16191618
self.console.log_status_update(
16201619
f"No models matched the selection criteria: {criteria}"
16211620
)
@@ -1701,6 +1700,10 @@ def table_diff(
17011700
except:
17021701
self.console.stop_table_diff_progress(success=False)
17031702
raise
1703+
else:
1704+
self.console.log_status_update(
1705+
f"No models contain differences with the selection criteria: {criteria}"
1706+
)
17041707

17051708
else:
17061709
table_diffs = [

tests/integrations/jupyter/test_magics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ def test_table_diff(notebook, loaded_sushi_context, convert_all_html_output_to_t
644644

645645
assert len(output.outputs) == 1
646646
assert convert_all_html_output_to_text(output) == [
647-
'Models without changes:\n└── "memory"."sushi"."top_waiters"'
647+
"No models contain differences with the selection criteria: 'sushi.top_waiters'"
648648
]
649649

650650

0 commit comments

Comments
 (0)