From cdbf75ea67d097ccc0f6261669ceab4dc720cc5d Mon Sep 17 00:00:00 2001 From: Quigley Malcolm Date: Thu, 14 Sep 2023 13:56:10 -0700 Subject: [PATCH] Improve validation error message for invalid names --- dbt_semantic_interfaces/validations/unique_valid_name.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dbt_semantic_interfaces/validations/unique_valid_name.py b/dbt_semantic_interfaces/validations/unique_valid_name.py index 97286f2c..e744c705 100644 --- a/dbt_semantic_interfaces/validations/unique_valid_name.py +++ b/dbt_semantic_interfaces/validations/unique_valid_name.py @@ -73,9 +73,10 @@ def check_valid_name(name: str, context: Optional[ValidationContext] = None) -> issues.append( ValidationError( context=context, - message=f"Invalid name `{name}` - names should only consist of lower case letters, numbers, " - f"and underscores. In addition, names should start with a lower case letter, and should not end " - f"with an underscore, and they must be at least 2 characters long.", + message=f"Invalid name `{name}` - names may only contain lower case letters, numbers, " + f"and underscores. Additionally, names must start with a lower case letter, cannot end " + f"with an underscore, cannot contain dunders (double underscores, or __), and must be " + f"at least 2 characters long.", ) ) if name.upper() in TimeGranularity.list_names():