acoustic-carpenter-78188
02/13/2023, 8:19 AMSdkLiteralType and move factory methods out of SdkBindingData
Type
☐ Bug Fix
☑︎ Feature
☐ Plugin
Are all requirements met?
☑︎ Code completed
☐ Smoke tested
☑︎ Unit tests added
☑︎ Code documentation added
☑︎ Any pending items have an associated Issue
Complete description
In the Sdk there is a SdkType that represent an abstraction for the type of a task or workflow and its multiple variables. However we are missing an equivalent to represent the type of a single value.
SdkBindingData.ofBindingCollection(
LiteralType.ofCollectionType(LiteralType.ofSimpleType(SimpleType.INTEGER)),
List.of(sum1.getOutputs().o(), sum2.getOutputs().o()));
The api module was designed to be stable a follow closely the proto classes, that is the reason of why is so verbose
Instead with the proper abstraction we could write this instead:
SdkBindingDatas.ofBindingCollection(
SdkLiteralTypes.integers(), List.of(sum1.getOutputs().o(), sum2.getOutputs().o()));
In addition, we moved the factory methods in SdkBindingData to it's own class, so Java and Scala have a more similar API
Tracking Issue
fixes flyteorg/flyte#3332
Follow-up issue
Not an issue yet, but SdkBindinDatas
flyteorg/flytekit-java
✅ All checks have passed
3/3 successful checksacoustic-carpenter-78188
02/13/2023, 8:19 AMacoustic-carpenter-78188
02/14/2023, 8:04 AM