<#3273 support passing optional date through CLI> ...
# flyte-github
c
#3273 support passing optional date through CLI Pull request opened by blaketastic2 ## Why are the changes needed? Currently, if we have a
workflow
with an optional date parameter, we cannot call this from the CLI. Workflow definition: @workflow def ingest_data( start_date: Optional[date] = None, ) -> None: pass Executing the workflow: pyflyte run --copy all -p flyte-snacks -d development --remote workflow.py ingest_data --start_date 2025-06-10 Produces this error:
Copy code
Invalid value for '--start_date': Failed to convert param: <Option start_date>, value: 2025-06-10 00:00:00 to type: typing.Optional[datetime.date]. Reason
Cannot convert from 2025-06-10 00:00:00 to typing.Optional[datetime.date]
## What changes were proposed in this pull request? We are now making sure to use the non-None variant when trying to do the conversion. https://bito.ai#summarystart| ### Summary by Bito This pull request enhances the CLI's handling of optional date parameters by introducing a new DateType class and correcting type conversion issues, specifically for optional datetime.date types. This improvement prevents type mismatch errors and ensures correct interpretation, thereby enhancing user experience when executing workflows with date parameters. flyteorg/flytekit