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

[flytekit-java] Add typed transform outputs #3251

Closed
2 tasks done
andresgomezfrr opened this issue Jan 20, 2023 · 1 comment
Closed
2 tasks done

[flytekit-java] Add typed transform outputs #3251

andresgomezfrr opened this issue Jan 20, 2023 · 1 comment
Labels
enhancement New feature or request flytekit-java Flytekit Java related issue

Comments

@andresgomezfrr
Copy link
Contributor

Motivation: Why do you think this is important?

Right now the user needs to know the output of a task because the only way to get it is using the getOutput("<attributeName>"). This is difficult during the development because you need to check the output class or docs to know what are the available types, also writing the name manually produces typos errors that only appear at registration time. The proposal here is to have some way to use the output class during the workflow development on that way you can access directly to the output class attributes.

Goal: What should the final outcome look like, ideally?

SumTaskOutput class

  @AutoValue
  public abstract static class SumOutput {

    public abstract SdkBindingData<Long> c();

    public static SumOutput create(SdkBindingData<Long> c) {
      return new AutoValue_SumTask_SumOutput(c);
    }
  }

Current status:

    SdkBindingData fib3 = builder.apply("fib-3", SumTask.of(fib1, fib2)).getOutput("c");

Desire status:

    SdkBindingData fib3 = builder.apply("fib-3", SumTask.of(fib1, fib2)).getOutputs().c();

This allows the user to auto-discover the output attributes using an IDE, and also. check that you choose only available attributes at compile time.

Describe alternatives you've considered

no alternatives

Propose: Link/Inline OR Additional context

flyteorg/flytekit-java#164

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@andresgomezfrr andresgomezfrr added enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers labels Jan 20, 2023
@narape narape added flytekit-java Flytekit Java related issue and removed untriaged This issues has not yet been looked at by the Maintainers labels Jan 20, 2023
@narape narape closed this as completed Jan 24, 2023
@narape
Copy link
Collaborator

narape commented Jan 24, 2023

Fixed in flyteorg/flytekit-java#164

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request flytekit-java Flytekit Java related issue
Projects
None yet
Development

No branches or pull requests

2 participants