From ca265e6d80d743375e5a0298b5878170216025ef Mon Sep 17 00:00:00 2001 From: Eyal Danieli Date: Wed, 22 Mar 2023 16:47:38 +0200 Subject: [PATCH] [Schedule] Update type hints for ScheduleCronTrigger to avoid unexpected pydantic behaviour (#3286) --- mlrun/api/schemas/schedule.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlrun/api/schemas/schedule.py b/mlrun/api/schemas/schedule.py index 0158a0c49d6..08a6df5822d 100644 --- a/mlrun/api/schemas/schedule.py +++ b/mlrun/api/schemas/schedule.py @@ -36,8 +36,8 @@ class ScheduleCronTrigger(BaseModel): hour: Optional[Union[int, str]] minute: Optional[Union[int, str]] second: Optional[Union[int, str]] - start_date: Optional[Union[datetime, str]] - end_date: Optional[Union[datetime, str]] + start_date: Union[datetime, str] = None + end_date: Union[datetime, str] = None # APScheduler also supports datetime.tzinfo type, but Pydantic doesn't - so we don't timezone: Optional[str]