@@ -3224,8 +3224,9 @@ def _print_models_with_threshold(
32243224 )
32253225 else :
32263226 for snapshot_table_info in models :
3227+ category_str = SNAPSHOT_CHANGE_CATEGORY_STR [snapshot_table_info .change_category ]
32273228 self ._print (
3228- f"- `{ snapshot_table_info .display_name (environment_naming_info , default_catalog if self .verbosity < Verbosity .VERY_VERBOSE else None , dialect = self .dialect )} `"
3229+ f"- `{ snapshot_table_info .display_name (environment_naming_info , default_catalog if self .verbosity < Verbosity .VERY_VERBOSE else None , dialect = self .dialect )} ` ( { category_str } ) "
32293230 )
32303231
32313232 def _print_modified_models (
@@ -3237,7 +3238,7 @@ def _print_modified_models(
32373238 no_diff : bool = True ,
32383239 ) -> None :
32393240 directly_modified = []
3240- indirectly_modified = []
3241+ indirectly_modified : t . List [ Snapshot ] = []
32413242 metadata_modified = []
32423243 for snapshot in modified_snapshots :
32433244 if context_diff .directly_modified (snapshot .name ):
@@ -3249,11 +3250,40 @@ def _print_modified_models(
32493250 if directly_modified :
32503251 self ._print ("\n **Directly Modified:**" )
32513252 for snapshot in sorted (directly_modified ):
3253+ category_str = SNAPSHOT_CHANGE_CATEGORY_STR [snapshot .change_category ]
32523254 self ._print (
3253- f"- `{ snapshot .display_name (environment_naming_info , default_catalog if self .verbosity < Verbosity .VERY_VERBOSE else None , dialect = self .dialect )} `"
3255+ f"* `{ snapshot .display_name (environment_naming_info , default_catalog if self .verbosity < Verbosity .VERY_VERBOSE else None , dialect = self .dialect )} ` ({ category_str } )"
3256+ )
3257+
3258+ indirectly_modified_children = sorted (
3259+ [s for s in indirectly_modified if snapshot .snapshot_id in s .parents ]
32543260 )
3261+
32553262 if not no_diff :
3256- self ._print (f"```diff\n { context_diff .text_diff (snapshot .name )} \n ```" )
3263+ diff_text = context_diff .text_diff (snapshot .name )
3264+ # sometimes there is no text_diff, like on a seed model where the data has been updated
3265+ if diff_text :
3266+ diff_text = f"\n ```diff\n { diff_text } \n ```"
3267+ # these are part of a Markdown list, so indent them by 2 spaces to relate them to the current list item
3268+ diff_text_indented = "\n " .join (
3269+ [f" { line } " for line in diff_text .splitlines ()]
3270+ )
3271+ self ._print (diff_text_indented )
3272+ else :
3273+ if indirectly_modified_children :
3274+ self ._print ("\n " )
3275+
3276+ if indirectly_modified_children :
3277+ self ._print (" Indirectly Modified Children:" )
3278+ for child_snapshot in indirectly_modified_children :
3279+ child_category_str = SNAPSHOT_CHANGE_CATEGORY_STR [
3280+ child_snapshot .change_category
3281+ ]
3282+ self ._print (
3283+ f" - `{ child_snapshot .display_name (environment_naming_info , default_catalog if self .verbosity < Verbosity .VERY_VERBOSE else None , dialect = self .dialect )} ` ({ child_category_str } )"
3284+ )
3285+ self ._print ("\n " )
3286+
32573287 if indirectly_modified :
32583288 self ._print ("\n **Indirectly Modified:**" )
32593289 self ._print_models_with_threshold (
0 commit comments