cuddly-jelly-27016
05/25/2025, 12:11 AMdataclass (struct) inputs such as:
@dataclass_json
@dataclass
class MyInput:
a: int
If a workflow now specifies this as an optional input, e.g. def my_workflow(a: Optional[MyInput]) one cannot input that through Flyte Console. Flyte Console crashed leading to a white screen.
### Expected behavior
Inputs in FlyteConsole work also for optional struct types.
### Additional context to reproduce
from dataclasses import dataclass
from typing import NamedTuple, Optional
from dataclasses_json import dataclass_json
from flytekit import task, workflow
@dataclass_json
@dataclass
class MyInput:
a: int
@task
def my_task():
return
@workflow
def my_workflow(a: Optional[MyInput]):
my_task()
if name == "__main__":
my_workflow(a=MyInput(a=5))
### Screenshots
Screen.Recording.2024-01-17.at.15.49.06.mov
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
05/25/2025, 12:11 AM