<#3294 [BUG] Bug in Union Type guessing for flyte remote> Issue created by <kumare3> Describe the bu...
a
#3294 [BUG] Bug in Union Type guessing for flyte remote Issue created by kumare3 Describe the bug Hi team, it appear that there a bug in flytekit on this line: https://github.com/flyteorg/flytekit/blob/master/flytekit/core/type_engine.py#L1141 When executing a task with Union-typed parameters using FlyteRemote, the above-mentioned line raises an Exception:
Copy code
File "/home/dev/conda_dev/devenv/Linux/envs/devenv-3.8-c/lib/python3.8/site-packages/flytekit/remote/remote.py", line 847, in execute
    return self.execute_remote_task_lp(
  File "/home/dev/conda_dev/devenv/Linux/envs/devenv-3.8-c/lib/python3.8/site-packages/flytekit/remote/remote.py", line 924, in execute_remote_task_lp
    return self._execute(
  File "/home/dev/conda_dev/devenv/Linux/envs/devenv-3.8-c/lib/python3.8/site-packages/flytekit/remote/remote.py", line 715, in _execute
    type_hints[k] = TypeEngine.guess_python_type(input_flyte_type_map[k].type)
  File "/home/dev/conda_dev/devenv/Linux/envs/devenv-3.8-c/lib/python3.8/site-packages/flytekit/core/type_engine.py", line 856, in guess_python_type
    return transformer.guess_python_type(flyte_type)
  File "/home/dev/conda_dev/devenv/Linux/envs/devenv-3.8-c/lib/python3.8/site-packages/flytekit/core/type_engine.py", line 1125, in guess_python_type
    return typing.Union[tuple(TypeEngine.guess_python_type(v.type) for v in literal_type.union_type.variants)]
  File "/home/dev/conda_dev/devenv/Linux/envs/devenv-3.8-c/lib/python3.8/site-packages/flytekit/core/type_engine.py", line 1125, in <genexpr>
    return typing.Union[tuple(TypeEngine.guess_python_type(v.type) for v in literal_type.union_type.variants)]
AttributeError: 'LiteralType' object has no attribute 'type'
The fix seems to be changing
v.type
->
v
Expected behavior It should work! Additional context to reproduce No response Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte