From 20ebde6bbc3610aacd47da70997f981c592a7b5e Mon Sep 17 00:00:00 2001 From: Nathan Zimmerman Date: Tue, 20 Feb 2024 15:34:28 -0600 Subject: [PATCH] Use traitlet's TraitError --- pangeo_forge_runner/bakery/base.py | 2 +- pangeo_forge_runner/commands/bake.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pangeo_forge_runner/bakery/base.py b/pangeo_forge_runner/bakery/base.py index c1cc913..1094253 100644 --- a/pangeo_forge_runner/bakery/base.py +++ b/pangeo_forge_runner/bakery/base.py @@ -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 diff --git a/pangeo_forge_runner/commands/bake.py b/pangeo_forge_runner/commands/bake.py index 87f203b..9c2a914 100644 --- a/pangeo_forge_runner/commands/bake.py +++ b/pangeo_forge_runner/commands/bake.py @@ -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