diff --git a/flyteidl-protos/pom.xml b/flyteidl-protos/pom.xml
index e4a7062bd..ee2e00475 100644
--- a/flyteidl-protos/pom.xml
+++ b/flyteidl-protos/pom.xml
@@ -21,7 +21,7 @@
org.flyte
flytekit-parent
- 0.3.29-SNAPSHOT
+ 0.4.0-SNAPSHOT
flyteidl-protos
diff --git a/flytekit-api/pom.xml b/flytekit-api/pom.xml
index 411e824fc..0ecf24fe2 100644
--- a/flytekit-api/pom.xml
+++ b/flytekit-api/pom.xml
@@ -21,7 +21,7 @@
org.flyte
flytekit-parent
- 0.3.29-SNAPSHOT
+ 0.4.0-SNAPSHOT
flytekit-api
diff --git a/flytekit-examples-scala/pom.xml b/flytekit-examples-scala/pom.xml
index e1ff978d1..d73556786 100644
--- a/flytekit-examples-scala/pom.xml
+++ b/flytekit-examples-scala/pom.xml
@@ -21,7 +21,7 @@
org.flyte
flytekit-parent
- 0.3.29-SNAPSHOT
+ 0.4.0-SNAPSHOT
flytekit-examples-scala
diff --git a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/AddQuestionTask.scala b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/AddQuestionTask.scala
index ea2b87d1f..96f6cad86 100644
--- a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/AddQuestionTask.scala
+++ b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/AddQuestionTask.scala
@@ -46,18 +46,3 @@ class AddQuestionTask
override def run(input: AddQuestionTaskInput): AddQuestionTaskOutput =
AddQuestionTaskOutput(ofString(s"${input.greeting.get} How are you?"))
}
-
-object AddQuestionTask {
-
- /** Binds input data to this task
- *
- * @param greeting
- * the input greeting message
- * @return
- * a transformed instance of this class with input data
- */
- def apply(
- greeting: SdkBindingData[String]
- ): SdkTransform[AddQuestionTaskOutput] =
- new AddQuestionTask().withInput("greeting", greeting)
-}
diff --git a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/DynamicFibonacciWorkflow.scala b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/DynamicFibonacciWorkflow.scala
index a2d26aa30..a468cd42f 100644
--- a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/DynamicFibonacciWorkflow.scala
+++ b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/DynamicFibonacciWorkflow.scala
@@ -23,9 +23,14 @@ import org.flyte.flytekitscala.{
SdkScalaWorkflowBuilder
}
+case class DynamicFibonacciWorkflowInput(n: SdkBindingData[Long])
case class DynamicFibonacciWorkflowOutput(output: SdkBindingData[Long])
class DynamicFibonacciWorkflow
- extends SdkScalaWorkflow[DynamicFibonacciWorkflowOutput](
+ extends SdkScalaWorkflow[
+ DynamicFibonacciWorkflowInput,
+ DynamicFibonacciWorkflowOutput
+ ](
+ SdkScalaType[DynamicFibonacciWorkflowInput],
SdkScalaType[DynamicFibonacciWorkflowOutput]
) {
@@ -34,7 +39,8 @@ class DynamicFibonacciWorkflow
val fibonacci = builder.apply(
"fibonacci",
- new DynamicFibonacciWorkflowTask().withInput("n", n)
+ new DynamicFibonacciWorkflowTask(),
+ DynamicFibonacciWorkflowTaskInput(n)
)
builder.output("output", fibonacci.getOutputs.output)
diff --git a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/DynamicFibonacciWorkflowTask.scala b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/DynamicFibonacciWorkflowTask.scala
index bda8db902..3a1e9a4cc 100644
--- a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/DynamicFibonacciWorkflowTask.scala
+++ b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/DynamicFibonacciWorkflowTask.scala
@@ -53,7 +53,11 @@ class DynamicFibonacciWorkflowTask
else
fib(
n + 1,
- builder(s"fib-${n + 1}", SumTask(value, prev)).getOutputs.c,
+ builder(
+ s"fib-${n + 1}",
+ new SumTask(),
+ SumTaskInput(value, prev)
+ ).getOutputs.c,
value
)
}
diff --git a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/FibonacciWorkflow.scala b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/FibonacciWorkflow.scala
index 637603c8e..b4a405a15 100644
--- a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/FibonacciWorkflow.scala
+++ b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/FibonacciWorkflow.scala
@@ -16,17 +16,22 @@
*/
package org.flyte.examples.flytekitscala
-import org.flyte.flytekit.{SdkBindingData, SdkWorkflow, SdkWorkflowBuilder}
+import org.flyte.flytekit.SdkBindingData
import org.flyte.flytekitscala.{
SdkScalaWorkflowBuilder,
SdkScalaType,
SdkScalaWorkflow
}
+case class FibonacciWorkflowInput(
+ fib0: SdkBindingData[Long],
+ fib1: SdkBindingData[Long]
+)
case class FibonacciWorkflowOutput(fib5: SdkBindingData[Long])
class FibonacciWorkflow
- extends SdkScalaWorkflow[FibonacciWorkflowOutput](
+ extends SdkScalaWorkflow[FibonacciWorkflowInput, FibonacciWorkflowOutput](
+ SdkScalaType[FibonacciWorkflowInput],
SdkScalaType[FibonacciWorkflowOutput]
) {
@@ -34,10 +39,22 @@ class FibonacciWorkflow
val fib0 = builder.inputOfInteger("fib0", "Value for Fib0")
val fib1 = builder.inputOfInteger("fib1", "Value for Fib1")
- val fib2 = builder.apply("fib-2", SumTask(fib0, fib1)).getOutputs.c
- val fib3 = builder.apply("fib-3", SumTask(fib1, fib2)).getOutputs.c
- val fib4 = builder.apply("fib-4", SumTask(fib2, fib3)).getOutputs.c
- val fib5 = builder.apply("fib-5", SumTask(fib3, fib4)).getOutputs.c
+ val fib2 = builder
+ .apply("fib-2", new SumTask(), SumTaskInput(fib0, fib1))
+ .getOutputs
+ .c
+ val fib3 = builder
+ .apply("fib-3", new SumTask(), SumTaskInput(fib1, fib2))
+ .getOutputs
+ .c
+ val fib4 = builder
+ .apply("fib-4", new SumTask(), SumTaskInput(fib2, fib3))
+ .getOutputs
+ .c
+ val fib5 = builder
+ .apply("fib-5", new SumTask(), SumTaskInput(fib3, fib4))
+ .getOutputs
+ .c
builder.output("fib5", fib5, "Value for Fib5")
}
diff --git a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/GreetTask.scala b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/GreetTask.scala
index b2c72ab6a..58ff7af5d 100644
--- a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/GreetTask.scala
+++ b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/GreetTask.scala
@@ -46,16 +46,3 @@ class GreetTask
override def run(input: GreetTaskInput): GreetTaskOutput =
GreetTaskOutput(ofString(s"Welcome, ${input.name.get()}!"))
}
-
-object GreetTask {
-
- /** Binds input data to this task
- *
- * @param name
- * the input name
- * @return
- * a transformed instance of this class with input data
- */
- def apply(name: SdkBindingData[String]): SdkTransform[GreetTaskOutput] =
- new GreetTask().withInput("name", name)
-}
diff --git a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/SumTask.scala b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/SumTask.scala
index 401cad51d..96d536f7e 100644
--- a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/SumTask.scala
+++ b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/SumTask.scala
@@ -43,11 +43,3 @@ class SumTask
override def isCacheSerializable: Boolean = true
}
-
-object SumTask {
- def apply(
- a: SdkBindingData[Long],
- b: SdkBindingData[Long]
- ): SdkTransform[SumTaskOutput] =
- new SumTask().withInput("a", a).withInput("b", b)
-}
diff --git a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/WelcomeWorkflow.scala b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/WelcomeWorkflow.scala
index 8c9e8d135..a75f63e1f 100644
--- a/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/WelcomeWorkflow.scala
+++ b/flytekit-examples-scala/src/main/scala/org/flyte/examples/flytekitscala/WelcomeWorkflow.scala
@@ -16,7 +16,7 @@
*/
package org.flyte.examples.flytekitscala
-import org.flyte.flytekit.{SdkBindingData, SdkWorkflow, SdkWorkflowBuilder}
+import org.flyte.flytekit.SdkBindingData
import org.flyte.flytekitscala.{
SdkScalaType,
SdkScalaWorkflow,
@@ -49,10 +49,12 @@ import org.flyte.flytekitscala.{
* | output: greeting(string) |
*/
+case class WelcomeWorkflowInput(name: SdkBindingData[String])
case class WelcomeWorkflowOutput(greeting: SdkBindingData[String])
class WelcomeWorkflow
- extends SdkScalaWorkflow[WelcomeWorkflowOutput](
+ extends SdkScalaWorkflow[WelcomeWorkflowInput, WelcomeWorkflowOutput](
+ SdkScalaType[WelcomeWorkflowInput],
SdkScalaType[WelcomeWorkflowOutput]
) {
@@ -61,11 +63,18 @@ class WelcomeWorkflow
val name = builder.inputOfString("name", "The name for the welcome message")
// uses the workflow input as the task input of the GreetTask
- val greeting = builder.apply("greet", GreetTask(name)).getOutputs.greeting
+ val greeting = builder
+ .apply("greet", new GreetTask(), GreetTaskInput(name))
+ .getOutputs
+ .greeting
// uses the output of the GreetTask as the task input of the AddQuestionTask
val greetingWithQuestion = builder
- .apply("add-question", AddQuestionTask(greeting))
+ .apply(
+ "add-question",
+ new AddQuestionTask(),
+ AddQuestionTaskInput(greeting)
+ )
.getOutputs
.greeting
diff --git a/flytekit-examples/pom.xml b/flytekit-examples/pom.xml
index 5f4ee4eb0..c82b45e91 100644
--- a/flytekit-examples/pom.xml
+++ b/flytekit-examples/pom.xml
@@ -21,7 +21,7 @@
org.flyte
flytekit-parent
- 0.3.29-SNAPSHOT
+ 0.4.0-SNAPSHOT
flytekit-examples
diff --git a/flytekit-examples/src/main/java/org/flyte/examples/AddQuestionTask.java b/flytekit-examples/src/main/java/org/flyte/examples/AddQuestionTask.java
index 81adc70c1..9c3803901 100644
--- a/flytekit-examples/src/main/java/org/flyte/examples/AddQuestionTask.java
+++ b/flytekit-examples/src/main/java/org/flyte/examples/AddQuestionTask.java
@@ -20,7 +20,6 @@
import com.google.auto.value.AutoValue;
import org.flyte.flytekit.SdkBindingData;
import org.flyte.flytekit.SdkRunnableTask;
-import org.flyte.flytekit.SdkTransform;
import org.flyte.flytekit.jackson.JacksonSdkType;
/**
@@ -34,16 +33,6 @@ public AddQuestionTask() {
super(JacksonSdkType.of(Input.class), JacksonSdkType.of(Output.class));
}
- /**
- * Binds input data to this task.
- *
- * @param greeting the input greeting message
- * @return a transformed instance of this class with input data
- */
- public static SdkTransform of(SdkBindingData greeting) {
- return new AddQuestionTask().withInput("greeting", greeting);
- }
-
/**
* Generate an immutable value class that represents {@link AddQuestionTask}'s input, which is a
* String.
@@ -51,6 +40,10 @@ public static SdkTransform of(SdkBindingData gre
@AutoValue
public abstract static class Input {
public abstract SdkBindingData greeting();
+
+ public static Input create(SdkBindingData greeting) {
+ return new AutoValue_AddQuestionTask_Input(greeting);
+ }
}
/**
diff --git a/flytekit-examples/src/main/java/org/flyte/examples/AllInputsTask.java b/flytekit-examples/src/main/java/org/flyte/examples/AllInputsTask.java
index 29038c835..46849fa7a 100644
--- a/flytekit-examples/src/main/java/org/flyte/examples/AllInputsTask.java
+++ b/flytekit-examples/src/main/java/org/flyte/examples/AllInputsTask.java
@@ -16,9 +16,6 @@
*/
package org.flyte.examples;
-import static java.util.Collections.emptyList;
-import static java.util.Collections.emptyMap;
-
import com.google.auto.service.AutoService;
import com.google.auto.value.AutoValue;
import java.time.Duration;
@@ -27,7 +24,6 @@
import java.util.Map;
import org.flyte.flytekit.SdkBindingData;
import org.flyte.flytekit.SdkRunnableTask;
-import org.flyte.flytekit.SdkTransform;
import org.flyte.flytekit.jackson.JacksonSdkType;
@AutoService(SdkRunnableTask.class)
@@ -38,30 +34,6 @@ public AllInputsTask() {
JacksonSdkType.of(AutoAllInputsInput.class), JacksonSdkType.of(AutoAllInputsOutput.class));
}
- public static SdkTransform of(
- SdkBindingData i,
- SdkBindingData f,
- SdkBindingData s,
- SdkBindingData b,
- SdkBindingData t,
- SdkBindingData d,
- SdkBindingData> l,
- SdkBindingData