ancient-wolf-19325
07/24/2024, 7:52 PM@dataclass_json
@dataclass
class InnerDataClass:
inner_name: str
@dataclass_json
@dataclass
class DataClassTest:
name: str
value: str
inner: List[str]
@task
def create_sweep(
...
test_list: List[DataClassTest],
...
) -> SweepInputs:
I will get error when launching this workflow:
ValueError: Only generic univariate typing.List[T] type is supported.
# Answer
Flyte currently does not fully support nested lists within dataclasses. This limitation is documented in several issues and discussions. For instance, according to this GitHub issue, Flyte's type system does not handle nested dataclasses or lists of dataclasses well, leading to type mismatches during workflow compilation.
Would you like more detail on potential workarounds or further explanation of the issue?
Sources:
- GitHub Issue: Can't launch task with nested dataclasses as input
- GitHub Issue: Accessing attributes fails on complex types
Slack Link
https://flyte-org.slack.com/archives/CP2HDHKE1/p1721850706.091839 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.