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

Inputs outputs wrapper #2075

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Inputs outputs wrapper #2075

wants to merge 3 commits into from

Conversation

EngHabu
Copy link
Collaborator

@EngHabu EngHabu commented Dec 29, 2023

Tracking issue

flyteorg/flyte#4654

Why are the changes needed?

Allow flytekit to pass additional information in outputs that can be propagated to the UI/flyteadmin and used in subsequent tasks..

What changes were proposed in this pull request?

How was this patch tested?

Setup process

Screenshots

Check all the applicable boxes

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

Related PRs

Docs link

Signed-off-by: Haytham Abuelfutuh <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
return literal_models.LiteralMap.from_flyte_idl(
utils.load_proto_from_file(literals_pb2.LiteralMap, tmp_name)
)
proto_type, value = utils.load_one_proto_from_file(tmp_name, literals_pb2.InputData,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting that we had to only change here,
did you update the getData method in flyteadmin, if so, this will need an additional if

lm = LiteralMap.from_flyte_idl(data_response.literal_map)

@@ -700,6 +700,40 @@ def from_flyte_idl(cls, pb2_object):
return cls({k: Literal.from_flyte_idl(v) for k, v in pb2_object.literals.items()})


class OutputData(_common.FlyteIdlEntity):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you should add a new property called

@property
def literals() -> Dict[str, Literal]:
  ...

This is to mimic -

def literals(self):

Otherwise, things like this will be missed IMO

execution._inputs = LiteralsResolver(input_literal_map.literals, interface.inputs, self.context)

you have handled it fine here as you convert to literalmap

@kumare3
Copy link
Contributor

kumare3 commented Jan 2, 2024

i think this PR needs a few rounds of testing

@EngHabu
Copy link
Collaborator Author

EngHabu commented Jan 2, 2024

I don't think it's complete, I agree... I only tested inputs/outputs for an execution... if you have scenarios in mind for testing, that would help a lot..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants