From c9f83b9e4d1711dbee2f64bdbaf2ccba36648f26 Mon Sep 17 00:00:00 2001 From: Quigley Malcolm Date: Fri, 12 Apr 2024 10:16:15 -0700 Subject: [PATCH] Alter `TotalModelNamesWithSpacesDeprecation` message to handle singular and plural --- core/dbt/events/types.py | 2 +- .../test_check_for_spaces_in_model_names.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/dbt/events/types.py b/core/dbt/events/types.py index 0d624fd4cbf..daf114042e7 100644 --- a/core/dbt/events/types.py +++ b/core/dbt/events/types.py @@ -442,7 +442,7 @@ def code(self) -> str: return "D015" def message(self) -> str: - description = f"Found {self.count_invalid_names} models with spaces in their names, which is deprecated." + description = f"Spaces in model names found in {self.count_invalid_names} model(s), which is deprecated." if self.show_debug_hint: description += " Run again with `--debug` to see them all." diff --git a/tests/functional/manifest_validations/test_check_for_spaces_in_model_names.py b/tests/functional/manifest_validations/test_check_for_spaces_in_model_names.py index 4c1cfd1bf61..44d1b160ada 100644 --- a/tests/functional/manifest_validations/test_check_for_spaces_in_model_names.py +++ b/tests/functional/manifest_validations/test_check_for_spaces_in_model_names.py @@ -62,7 +62,8 @@ def tests_debug_when_spaces_in_name(self, project) -> None: assert len(spaces_check_catcher.caught_events) == 1 assert len(total_catcher.caught_events) == 1 assert ( - "Found 2 models with spaces in their names" in total_catcher.caught_events[0].info.msg + "Found 2 model(s) with spaces in their names" + in total_catcher.caught_events[0].info.msg ) assert ( "Run again with `--debug` to see them all." in total_catcher.caught_events[0].info.msg