Skip to content

Commit

Permalink
fix: add raise to exceptions (#4080)
Browse files Browse the repository at this point in the history
  • Loading branch information
caroger authored Jul 30, 2024
1 parent 6219e91 commit 4331fdd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/phoenix/experiments/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def from_dict(cls, obj: Mapping[str, Any]) -> ExperimentRun:

def __post_init__(self) -> None:
if bool(self.output) == bool(self.error):
ValueError("Must specify exactly one of experiment_run_output or error")
raise ValueError("Must specify exactly one of experiment_run_output or error")


@dataclass(frozen=True)
Expand All @@ -249,7 +249,7 @@ def from_dict(cls, obj: Optional[Mapping[str, Any]]) -> Optional[EvaluationResul

def __post_init__(self) -> None:
if self.score is None and not self.label:
ValueError("Must specify score or label, or both")
raise ValueError("Must specify score or label, or both")
if self.score is None and not self.label:
object.__setattr__(self, "score", 0)
for k in ("label", "explanation"):
Expand Down Expand Up @@ -285,7 +285,7 @@ def from_dict(cls, obj: Mapping[str, Any]) -> ExperimentEvaluationRun:

def __post_init__(self) -> None:
if bool(self.result) == bool(self.error):
ValueError("Must specify either result or error")
raise ValueError("Must specify either result or error")


ExperimentTask: TypeAlias = Union[
Expand Down

0 comments on commit 4331fdd

Please sign in to comment.