flytekit
flytekit copied to clipboard
support passing optional date through CLI
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:
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.