Skip to content

Commit 371e8be

Browse files
author
André Luiz Abdalla Silveira
committed
fix(api): accept int or str for timestamps seconds
The timestamp parameters can be passed as either a numeric string or an integer. Update the ListingInterval type annotation from Optional[str] to Optional[str | int] so pydantic validates both correctly. resolve_date_range already handles both via float() conversion.
1 parent eb67460 commit 371e8be

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/kernelCI_app/typeModels/commonListing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ class ListingInterval(BaseModel):
1616
),
1717
make_default_validator(DEFAULT_INTERVAL_IN_DAYS),
1818
]
19-
startTimestampInSeconds: Optional[str] = Field( # noqa: N815
19+
startTimestampInSeconds: Optional[str | int] = Field( # noqa: N815
2020
default=None,
2121
description=DocStrings.DEFAULT_START_TS_DESCRIPTION,
2222
)
23-
endTimestampInSeconds: Optional[str] = Field( # noqa: N815
23+
endTimestampInSeconds: Optional[str | int] = Field( # noqa: N815
2424
default=None,
2525
description=DocStrings.DEFAULT_END_TS_DESCRIPTION,
2626
)

0 commit comments

Comments
 (0)