Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add raise keyword before exceptions in experiments.types #4080

Merged
merged 1 commit into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading