flytekit icon indicating copy to clipboard operation
flytekit copied to clipboard

[WIP][Flytekit] Add variable_map in LiteralResolver for FlyteRemote.get Error on Dataclass/Pydantic Models

Open mao3267 opened this issue 1 year ago • 6 comments

Tracking issue

flyteorg/flyte#6081

Why are the changes needed?

While the task input/output is represented as a dataclass or Pydantic model, using the get function to fetch the FlyteRemote execution output will fail due to the absence of the variable_map information. To address this issue, we aim to provide the input/output variable_map in LiteralResolver to address this issue.

What changes were proposed in this pull request?

  1. Add variable_map in LiteralResolver
  2. Unit Tests should be added

How was this patch tested?

TODO

Setup process

git clone https://github.com/flyteorg/flytekit.git
gh pr checkout 2933
pip install -e .

Screenshots

TODO

Check all the applicable boxes

  • [ ] I updated the documentation accordingly.
  • [ ] All new and existing tests passed.
  • [ ] All commits are signed-off.

Related PRs

flyteorg/flyte#6136

Docs link

Summary by Bito

Enhanced FlyteRemote's LiteralResolver to improve handling of dataclass and Pydantic model inputs/outputs. Implementation includes proper handling of variable map information from data response, with null checks for variable_map field to prevent access issues. The changes standardize the use of LiteralsResolver and remove redundant empty interface checks, resulting in more robust handling of complex data types.

Unit tests added: False

Estimated effort to review (1-5, lower is better): 1

mao3267 avatar Jan 04 '25 03:01 mao3267