```from typing import Union from dataclasses impor...
# flyte-support
c
Copy code
from typing import Union
from dataclasses import dataclass
from flytekit import task, workflow

@dataclass
class A:
    a: int

@dataclass
class B:
    b: int

@task
def foo(inp: Union[A, B]):
    ...

@workflow
def wf():
    foo(inp=B(b=1))

if __name__ == "__main__":
    wf()
Our users want to do something like this and I also would have naively expected this should work but it actually doesn’t. Details in 🧵 Would be curious if somebody knows how to fix this 🙏
f
Ohh man - the dreaded union type
😿 2