Search in sources :

Example 6 with PartialTaskIdentifier

use of org.flyte.api.v1.PartialTaskIdentifier in project flytekit-java by flyteorg.

the class IdentifierRewriteTest method shouldNotRewriteTaskIdentifierWhenVersionIsSet.

@Test
void shouldNotRewriteTaskIdentifierWhenVersionIsSet() {
    PartialTaskIdentifier rewrittenTaskId = rewriter.apply(PartialTaskIdentifier.builder().project("external-project").domain("external-domain").name("external-task").version("external-version").build());
    assertThat(rewrittenTaskId, equalTo(PartialTaskIdentifier.builder().project("external-project").domain("external-domain").name("external-task").version("external-version").build()));
    verifyNoInteractions(client);
}
Also used : PartialTaskIdentifier(org.flyte.api.v1.PartialTaskIdentifier) Test(org.junit.jupiter.api.Test)

Example 7 with PartialTaskIdentifier

use of org.flyte.api.v1.PartialTaskIdentifier in project flytekit-java by flyteorg.

the class SdkDynamicWorkflowTask method apply.

@Override
public SdkNode apply(SdkWorkflowBuilder builder, String nodeId, List<String> upstreamNodeIds, @Nullable SdkNodeMetadata metadata, Map<String, SdkBindingData> inputs) {
    PartialTaskIdentifier taskId = PartialTaskIdentifier.builder().name(getName()).build();
    List<CompilerError> errors = Compiler.validateApply(nodeId, inputs, getInputType().getVariableMap());
    if (!errors.isEmpty()) {
        throw new CompilerException(errors);
    }
    return new SdkTaskNode(builder, nodeId, taskId, upstreamNodeIds, metadata, inputs, outputType.getVariableMap());
}
Also used : PartialTaskIdentifier(org.flyte.api.v1.PartialTaskIdentifier)

Example 8 with PartialTaskIdentifier

use of org.flyte.api.v1.PartialTaskIdentifier in project flytekit-java by flyteorg.

the class SdkRunnableTask method apply.

@Override
public SdkNode apply(SdkWorkflowBuilder builder, String nodeId, List<String> upstreamNodeIds, @Nullable SdkNodeMetadata metadata, Map<String, SdkBindingData> inputs) {
    PartialTaskIdentifier taskId = PartialTaskIdentifier.builder().name(getName()).build();
    List<CompilerError> errors = Compiler.validateApply(nodeId, inputs, getInputType().getVariableMap());
    if (!errors.isEmpty()) {
        throw new CompilerException(errors);
    }
    return new SdkTaskNode(builder, nodeId, taskId, upstreamNodeIds, metadata, inputs, outputType.getVariableMap());
}
Also used : PartialTaskIdentifier(org.flyte.api.v1.PartialTaskIdentifier)

Aggregations

PartialTaskIdentifier (org.flyte.api.v1.PartialTaskIdentifier)8 Test (org.junit.jupiter.api.Test)5 BooleanExpression (org.flyte.api.v1.BooleanExpression)1 BranchNode (org.flyte.api.v1.BranchNode)1 ComparisonExpression (org.flyte.api.v1.ComparisonExpression)1 IfBlock (org.flyte.api.v1.IfBlock)1 Node (org.flyte.api.v1.Node)1 TaskNode (org.flyte.api.v1.TaskNode)1 WorkflowNode (org.flyte.api.v1.WorkflowNode)1