worried-airplane-87065
05/27/2025, 4:59 PM@task
def some_task(some_num: int | None):
pass
jolly-florist-66728
05/27/2025, 4:59 PMfrom typing import Optional
from flytekit import task
@task
def some_task(some_num: Optional[int] = None):
pass
According to Support for Optional value types in Tasks and Flyte Technical Summary, this pattern is supported, but you should avoid using mutable default arguments (like lists or dicts) as defaults.
Would you like more detail or examples on how this works in workflows?
Sources:
- Support for Optional value types in Tasks
- Flyte Technical Summary 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.