Skip to content

Commit

Permalink
Fix data validation for Priority
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed Sep 28, 2022
1 parent aa3a030 commit c9c00eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions beaker/data_model/experiment_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c9c00eb

Please sign in to comment.