<#4268 [BUG] SdkCondition as WorkflowBuilder tran...
# flyte-github
a
#4268 [BUG] SdkCondition as WorkflowBuilder transformation compiles with SdkWorkflowBuilder but not with SdkScalaWorkflowBuilder Issue created by leoch20 Describe the bug I would expect
SdkWorkflowBuilder
and
SdkScalaWorkflowBuilder
to have similar behaviours. However, the code below compiles if using
SdkWorkflowBuilder
and fails with
SdkScalaWorkflowBuilder
Copy code
import org.flyte.flytekit.{SdkBindingData, SdkConditions, SdkRunnableTask, SdkWorkflowBuilder}
import org.flyte.flytekitscala.{SdkBindingDataFactory, SdkScalaType, SdkScalaWorkflowBuilder}

object Test {
  case class Person(
    name: String
  )

  class PersonProcessor extends SdkRunnableTask(SdkScalaType[Person], SdkScalaType[Person]) {
    override def run(input: Person): Person =
      input
  }

  trait PersonTrait {
    val person: Person

    def processPerson(
      // TODO: The builder compiles with SdkWorkflowBuilder but not with SdkScalaWorkflowBuilder
      builder: SdkScalaWorkflowBuilder,
      flag: SdkBindingData[Boolean]
    ): Person =
      builder
        .apply(
          SdkConditions
            .when(
              "true",
              SdkConditions.eq(SdkBindingDataFactory.of(true), flag),
              new PersonProcessor,
              person
            )
            .otherwise("false", new PersonProcessor, person)
        )
        .getOutputs
  }
}
Expected behavior
SdkScalaWorkflowBuilder.apply
should take a
SdkConditions
as a valid transformation. Additional context to reproduce No response Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte