<#193 Refactor SdkBindindData factory methods> Pul...
# flyte-github
a
#193 Refactor SdkBindindData factory methods Pull request opened by narape TL;DR Add
SdkLiteralType
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.
Copy code
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:
Copy code
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 checks