Skip to content

Commit 5f1ce1c

Browse files
authored
Chore: show only one of direct/indirect/metadata update in console summary (#3931)
1 parent 5cd9ced commit 5f1ce1c

2 files changed

Lines changed: 4 additions & 13 deletions

File tree

sqlmesh/core/console.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,13 +984,13 @@ def _show_summary_tree_for(
984984
)
985985
elif context_diff.indirectly_modified(name):
986986
indirect.add(f"[indirect]{display_name}")
987-
988-
if context_diff.metadata_updated(name):
987+
elif context_diff.metadata_updated(name):
989988
metadata.add(
990989
f"[metadata]{display_name}"
991990
if no_diff
992991
else Syntax(f"{display_name}\n{context_diff.text_diff(name)}", "sql")
993992
)
993+
994994
if direct.children:
995995
tree.add(direct)
996996
if indirect.children:

tests/integrations/jupyter/test_magics.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def test_diff(sushi_context, notebook, convert_all_html_output_to_text, get_all_
238238
assert len(output.outputs) == 2
239239
assert convert_all_html_output_to_text(output) == [
240240
"Differences from the `prod` environment:",
241-
"Models:\n── Directly Modified:\n│ └── sqlmesh_example.test\n└── Metadata Updated:\n └── sqlmesh_example.test",
241+
"Models:\n── Directly Modified:\n └── sqlmesh_example.test",
242242
]
243243
assert get_all_html_output(output) == [
244244
str(
@@ -266,7 +266,7 @@ def test_diff(sushi_context, notebook, convert_all_html_output_to_text, get_all_
266266
autoescape=False,
267267
)
268268
)
269-
+ "── "
269+
+ "── "
270270
+ str(
271271
h(
272272
"span",
@@ -275,15 +275,6 @@ def test_diff(sushi_context, notebook, convert_all_html_output_to_text, get_all_
275275
autoescape=False,
276276
)
277277
)
278-
+ "│ └── sqlmesh_example.test└── "
279-
+ str(
280-
h(
281-
"span",
282-
{"style": "font-weight: bold"},
283-
"Metadata Updated:",
284-
autoescape=False,
285-
)
286-
)
287278
+ " └── sqlmesh_example.test",
288279
autoescape=False,
289280
)

0 commit comments

Comments
 (0)