Skip to content

Commit

Permalink
Minor correction to error message (#426)
Browse files Browse the repository at this point in the history
Related to iterative/dvc#9821

---------

Co-authored-by: Dave Berenbaum <dave.berenbaum@gmail.com>
  • Loading branch information
tapadipti and dberenbaum authored Oct 10, 2023
1 parent 701fa68 commit 9dab2f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gto/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@ def check_string_is_valid(value, regex=name_re):
def assert_name_is_valid(value):
if not check_string_is_valid(value, regex=name_re):
raise ValidationError(
f"Invalid value '{value}'. Only lowercase english letters, , '-', '/' are allowed."
"Value must be of len >= 2, must with a letter and end with a letter or a number."
f"Invalid value '{value}'. Only letters, numbers, '_', '-', '/' are allowed."
"Value must be of len >= 2 and must start and end with a letter or a number."
)


def assert_fullname_is_valid(value):
if not check_string_is_valid(value, regex=fullname_re):
# fix error message to be regex-specific
raise ValidationError(
f"Invalid value '{value}'. Only lowercase english letters, , '-', '/' are allowed."
"Value must be of len >= 2, must start with a letter and end with a letter or a number."
f"Invalid value '{value}'. Only letters, numbers, '_', '-', '/' are allowed."
"Value must be of len >= 2 and must start and end with a letter or a number."
)


Expand Down

0 comments on commit 9dab2f5

Please sign in to comment.