acoustic-carpenter-78188
02/28/2023, 1:53 PM@AutoService(SdkRunnableTask.class)
public class ToUpperCaseTask extends SdkRunnableTask<ToUpperCaseTask.Input, ToUpperCaseTask.Output> {
public ToUpperCaseTask() {
super(JacksonSdkType.of(Input.class), JacksonSdkType.of(Output.class));
}
@AutoValue
public abstract static class Input {
public abstract SdkBindingData<String> in();
}
@AutoValue
public abstract static class Output {
public abstract SdkBindingData<String> out();
public static Output create(String out) {
return new AutoValue_ToUpperCaseTask_Output(out);
}
}
@Override
public Output run(Input input) {
return Output.create(SdkBindingDataFactory.of(input.get().toUpperCase()));
}
}
For such trivial task, defining the AutoValues to define the types takes the majority of the lines, i.e. it is too verbose.
It would be cool to have an alternative way to express the same in a simpler way
Goal: What should the final outcome look like, ideally?
I would like to have a way to define this simple types as one liner: SdkTypes.of(SdkLiteralTypes.strings(), "str")
Describe alternatives you've considered
I have considered code generation, but it has a cost and it is better to explore first alternatives without it
Propose: Link/Inline OR Additional context
No response
Are you sure this issue hasn't been raised already?
☑︎ Yes
Have you read the Code of Conduct?
☑︎ Yes
flyteorg/flyteacoustic-carpenter-78188
02/28/2023, 1:58 PM