Skip to content

Commit

Permalink
Improve validation error message for invalid names
Browse files Browse the repository at this point in the history
  • Loading branch information
QMalcolm committed Sep 15, 2023
1 parent 731a75e commit cdbf75e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dbt_semantic_interfaces/validations/unique_valid_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit cdbf75e

Please sign in to comment.