Hi team, it appear that there a bug in flytekit on...
# ask-the-community
l
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
to just
v
k
This sounds like a bug, how did this slip
Cc @Eduardo Apolinario (eapolinario)
@Leiqing you are right it should be v
Would you be open to either filing a bug or opening a PR?
[flyte-bug]
k
If you +1, would be great
l
Thanks Ketan!
183 Views