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

🤖 Add Validation for 'id' Field in ThreadDetails Model #1109

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
22 changes: 14 additions & 8 deletions src/seer/automation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,14 +289,20 @@ def validate_stacktrace(cls, sentry_stacktrace: SentryStacktrace | Stacktrace):


class ThreadDetails(BaseModel):
id: int
name: Optional[str] = None
crashed: Optional[bool] = False
current: Optional[bool] = False
state: Optional[str] = None
main: Optional[bool] = False

stacktrace: Optional[Stacktrace] = None
id: int
name: Optional[str] = None
crashed: Optional[bool] = False
current: Optional[bool] = False
state: Optional[str] = None
main: Optional[bool] = False
stacktrace: Optional[Stacktrace] = None

@field_validator("id", mode="before")
@classmethod
def validate_id(cls, v):
if v is None:
raise ValueError("id cannot be None")
return v

@field_validator("stacktrace", mode="before")
@classmethod
Expand Down
Loading