<#6662 [BUG] Failure using Union types with flyte ...
# flyte-github
a
#6662 [BUG] Failure using Union types with flyte copilot for remote executions Issue created by ddl-rliu ### Flyte & Flytekit version Flyte 1.15.3 and Flytekit 1.15.3 ### Describe the bug Failed to run a ContainerTask task remote excecution with
typing.Union
inputs because the flyte copilot fails.
Copy code
{"level":"error","msg":"Failed to persist [spec], err unsupported scalar type [*core.Scalar_Union]",...}
{"level":"info","msg":"Exited downloading inputs from [.../inputs.pb]",...}
{"level":"error","msg":"Downloading failed, err failed to download input variable from remote store: variable [spec] download/store failed: unsupported scalar type [*core.Scalar_Union]",...}
Context: Support for Union types in the Flyte IDL was added in #1349, but there is still a small missing piece in flytecopilot to support downloading Union-type scalars for ContainerTask/AsyncConnector flyte tasks. Proposed fix: Add a logical path for
typing.Union
types – #6661 #6674 ### Expected behavior Tasks with
typing.Union
inputs should work with flyte copilot. ### Additional context to reproduce Workflow code idea for reproducing the error.
Copy code
# Run with `pyflyte run --remote`

@MyContainerTask
def t1() -> str:
    return "hello"


@MyContainerTask
def t2(ff: Union[str, int]) -> bool:
    return ff == "hello"


@workflow
def wf() -> bool:
    return t2(ff=t1())


if __name__ == "__main__":
    wf()
### Screenshots No response ### Are you sure this issue hasn't been raised already? • Yes ### Have you read the Code of Conduct? • Yes flyteorg/flyte