Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Bug in Union Type guessing for flyte remote #3294

Closed
2 tasks done
kumare3 opened this issue Jan 30, 2023 · 0 comments · Fixed by flyteorg/flytekit#1426
Closed
2 tasks done

[BUG] Bug in Union Type guessing for flyte remote #3294

kumare3 opened this issue Jan 30, 2023 · 0 comments · Fixed by flyteorg/flytekit#1426
Labels
bug Something isn't working flytekit FlyteKit Python related issue

Comments

@kumare3
Copy link
Contributor

kumare3 commented Jan 30, 2023

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:

  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
@kumare3 kumare3 added bug Something isn't working flytekit FlyteKit Python related issue labels Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flytekit FlyteKit Python related issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant