Skip to content

Commit

Permalink
fix(chalice): fixed string fetchDuration value support
Browse files Browse the repository at this point in the history
  • Loading branch information
tahayk committed Jan 30, 2025
1 parent c2ce9b8 commit 70f31b4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions api/schemas/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,13 @@ class RequestGraphqlFilterSchema(BaseModel):
value: List[Union[int, str]] = Field(...)
operator: Union[SearchEventOperator, MathOperator] = Field(...)

@model_validator(mode="before")
@classmethod
def _transform_data(cls, values):
if values.get("type") in [FetchFilterType.FETCH_DURATION, FetchFilterType.FETCH_STATUS_CODE]:
values["value"] = [int(v) for v in values["value"] if v is not None and v.isnumeric()]
return values


class SessionSearchEventSchema2(BaseModel):
is_event: Literal[True] = True
Expand Down

0 comments on commit 70f31b4

Please sign in to comment.