@@ -1406,16 +1406,16 @@ def show_model_difference_summary(
14061406 ignored_snapshot_ids = ignored_snapshot_ids or set ()
14071407 if context_diff .is_new_environment :
14081408 self ._print (
1409- f"**New environment `{ context_diff .environment } ` will be created from `{ context_diff .create_from } `**\n \n "
1409+ f"**New environment `{ context_diff .environment } ` will be created from `{ context_diff .create_from } `**\n "
14101410 )
14111411 if not context_diff .has_snapshot_changes :
14121412 return
14131413
14141414 if not context_diff .has_changes :
1415- self ._print (f"**No differences when compared to `{ context_diff .environment } `**\n \n " )
1415+ self ._print (f"**No differences when compared to `{ context_diff .environment } `**\n " )
14161416 return
14171417
1418- self ._print (f"**Summary of differences against `{ context_diff .environment } `:**\n \n " )
1418+ self ._print (f"**Summary of differences against `{ context_diff .environment } `:**\n " )
14191419
14201420 added_snapshots = {
14211421 context_diff .snapshots [s_id ]
@@ -1424,21 +1424,19 @@ def show_model_difference_summary(
14241424 }
14251425 added_snapshot_models = {s for s in added_snapshots if s .is_model }
14261426 if added_snapshot_models :
1427- self ._print (f"**Added Models:**\n " )
1428- for snapshot in added_snapshot_models :
1427+ self ._print (f"\n **Added Models:**" )
1428+ for snapshot in sorted ( added_snapshot_models ) :
14291429 self ._print (
1430- f"- { snapshot .display_name (environment_naming_info , default_catalog )} \n "
1430+ f"- ` { snapshot .display_name (environment_naming_info , default_catalog )} ` "
14311431 )
1432- self ._print ("\n " )
14331432
14341433 added_snapshot_audits = {s for s in added_snapshots if s .is_audit }
14351434 if added_snapshot_audits :
1436- self ._print (f"**Added Standalone Audits:**\n " )
1437- for snapshot in added_snapshot_audits :
1435+ self ._print (f"\n **Added Standalone Audits:**" )
1436+ for snapshot in sorted ( added_snapshot_audits ) :
14381437 self ._print (
1439- f"- { snapshot .display_name (environment_naming_info , default_catalog )} \n "
1438+ f"- ` { snapshot .display_name (environment_naming_info , default_catalog )} ` "
14401439 )
1441- self ._print ("\n " )
14421440
14431441 removed_snapshot_table_infos = {
14441442 snapshot_table_info
@@ -1447,21 +1445,19 @@ def show_model_difference_summary(
14471445 }
14481446 removed_model_snapshot_table_infos = {s for s in removed_snapshot_table_infos if s .is_model }
14491447 if removed_model_snapshot_table_infos :
1450- self ._print (f"**Removed Models:**\n " )
1451- for snapshot_table_info in removed_model_snapshot_table_infos :
1448+ self ._print (f"\n **Removed Models:**" )
1449+ for snapshot_table_info in sorted ( removed_model_snapshot_table_infos ) :
14521450 self ._print (
1453- f"- { snapshot_table_info .display_name (environment_naming_info , default_catalog )} \n "
1451+ f"- ` { snapshot_table_info .display_name (environment_naming_info , default_catalog )} ` "
14541452 )
1455- self ._print ("\n " )
14561453
14571454 removed_audit_snapshot_table_infos = {s for s in removed_snapshot_table_infos if s .is_audit }
14581455 if removed_audit_snapshot_table_infos :
1459- self ._print (f"**Removed Standalone Audits:**\n " )
1460- for snapshot_table_info in removed_audit_snapshot_table_infos :
1456+ self ._print (f"\n **Removed Standalone Audits:**" )
1457+ for snapshot_table_info in sorted ( removed_audit_snapshot_table_infos ) :
14611458 self ._print (
1462- f"- { snapshot_table_info .display_name (environment_naming_info , default_catalog )} \n "
1459+ f"- ` { snapshot_table_info .display_name (environment_naming_info , default_catalog )} ` "
14631460 )
1464- self ._print ("\n " )
14651461
14661462 modified_snapshots = {
14671463 current_snapshot
@@ -1480,43 +1476,39 @@ def show_model_difference_summary(
14801476 elif context_diff .metadata_updated (snapshot .name ):
14811477 metadata_modified .append (snapshot )
14821478 if directly_modified :
1483- self ._print (f"**Directly Modified:**\n " )
1484- for snapshot in directly_modified :
1479+ self ._print (f"\n **Directly Modified:**" )
1480+ for snapshot in sorted ( directly_modified ) :
14851481 self ._print (
1486- f"- `{ snapshot .display_name (environment_naming_info , default_catalog )} `\n "
1482+ f"- `{ snapshot .display_name (environment_naming_info , default_catalog )} `"
14871483 )
14881484 if not no_diff :
1489- self ._print (f"```diff\n { context_diff .text_diff (snapshot .name )} \n ```\n " )
1490- self ._print ("\n " )
1485+ self ._print (f"```diff\n { context_diff .text_diff (snapshot .name )} \n ```" )
14911486 if indirectly_modified :
1492- self ._print (f"**Indirectly Modified:**\n " )
1493- for snapshot in indirectly_modified :
1487+ self ._print (f"\n **Indirectly Modified:**" )
1488+ for snapshot in sorted ( indirectly_modified ) :
14941489 self ._print (
1495- f"- `{ snapshot .display_name (environment_naming_info , default_catalog )} `\n "
1490+ f"- `{ snapshot .display_name (environment_naming_info , default_catalog )} `"
14961491 )
1497- self ._print ("\n " )
14981492 if metadata_modified :
1499- self ._print (f"**Metadata Updated:**\n " )
1500- for snapshot in metadata_modified :
1493+ self ._print (f"\n **Metadata Updated:**" )
1494+ for snapshot in sorted ( metadata_modified ) :
15011495 self ._print (
1502- f"- `{ snapshot .display_name (environment_naming_info , default_catalog )} `\n "
1496+ f"- `{ snapshot .display_name (environment_naming_info , default_catalog )} `"
15031497 )
1504- self ._print ("\n " )
15051498 if ignored_snapshot_ids :
1506- self ._print (f"**Ignored Models (Expected Plan Start):**\n " )
1507- for s_id in ignored_snapshot_ids :
1499+ self ._print (f"\n **Ignored Models (Expected Plan Start):**" )
1500+ for s_id in sorted ( ignored_snapshot_ids ) :
15081501 snapshot = context_diff .snapshots [s_id ]
15091502 self ._print (
1510- f"- `{ snapshot .display_name (environment_naming_info , default_catalog )} ` ({ snapshot .get_latest (start_date (snapshot , context_diff .snapshots .values ()))} )\n "
1503+ f"- `{ snapshot .display_name (environment_naming_info , default_catalog )} ` ({ snapshot .get_latest (start_date (snapshot , context_diff .snapshots .values ()))} )"
15111504 )
1512- self ._print ("\n " )
15131505
15141506 def _show_missing_dates (self , plan : Plan , default_catalog : t .Optional [str ]) -> None :
15151507 """Displays the models with missing dates."""
15161508 missing_intervals = plan .missing_intervals
15171509 if not missing_intervals :
15181510 return
1519- self ._print ("**Models needing backfill (missing dates):**\n \n " )
1511+ self ._print ("\n **Models needing backfill (missing dates):**" )
15201512 for missing in missing_intervals :
15211513 snapshot = plan .context_diff .snapshots [missing .snapshot_id ]
15221514 if not snapshot .is_model :
@@ -1527,9 +1519,8 @@ def _show_missing_dates(self, plan: Plan, default_catalog: t.Optional[str]) -> N
15271519 preview_modifier = " (**preview**)"
15281520
15291521 self ._print (
1530- f"* `{ snapshot .display_name (plan .environment_naming_info , default_catalog )} `: { missing .format_intervals (snapshot .node .interval_unit )} { preview_modifier } \n "
1522+ f"* `{ snapshot .display_name (plan .environment_naming_info , default_catalog )} `: { missing .format_intervals (snapshot .node .interval_unit )} { preview_modifier } "
15311523 )
1532- self ._print ("\n " )
15331524
15341525 def _show_categorized_snapshots (self , plan : Plan , default_catalog : t .Optional [str ]) -> None :
15351526 context_diff = plan .context_diff
0 commit comments