diff --git a/CHANGELOG.md b/CHANGELOG.md index 97575b6..8a12407 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ use patch releases for compatibility fixes instead. ## Unreleased +### Fixed + +- Fixed data validation for job/task `Priority`. "urgent" now allowed. + ## [v1.10.2](https://github.com/allenai/beaker-py/releases/tag/v1.10.2) - 2022-09-27 ### Fixed diff --git a/beaker/data_model/experiment_spec.py b/beaker/data_model/experiment_spec.py index 5519cbf..9c32a5a 100644 --- a/beaker/data_model/experiment_spec.py +++ b/beaker/data_model/experiment_spec.py @@ -279,9 +279,9 @@ class TaskContext(BaseModel, frozen=False): @validator("priority") def _validate_priority(cls, v: str) -> str: - if v is not None and v not in {"preemptible", "low", "normal", "high"}: + if v is not None and v not in set(Priority): raise ValueError( - "Invalided 'priority'. Value must be one of 'preemptible', 'low', 'normal', or 'high'." + f"Invalided 'priority'. Value must be one of {[p.value for p in Priority]} (got '{v}')." ) return v