fix(chalice): fixed string fetchDuration value support (#2989)

This commit is contained in:
Kraiem Taha Yassine 2025-01-30 15:07:21 +01:00 committed by GitHub
parent c2ce9b8466
commit 5c1e5078b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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