Skip to content

Commit

Permalink
Use traitlet's TraitError
Browse files Browse the repository at this point in the history
  • Loading branch information
moradology committed Feb 20, 2024
1 parent 191955a commit 20ebde6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pangeo_forge_runner/bakery/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import List

from apache_beam.pipeline import Pipeline, PipelineOptions
from traitlets import Bool, TraitError
from traitlets import TraitError
from traitlets.config import LoggingConfigurable

from ..commands.bake import Bake, ExecutionMetadata
Expand Down
2 changes: 1 addition & 1 deletion pangeo_forge_runner/commands/bake.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _validate_job_name(self, proposal):
"""
validating_regex = r"^[a-z][-_0-9a-z]{0,62}$"
if not re.match(validating_regex, proposal.value):
raise ValueError(
raise TraitError(
f"job_name must match the regex {validating_regex}, instead found {proposal.value}"
)
return proposal.value
Expand Down

0 comments on commit 20ebde6

Please sign in to comment.