Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deep copying arraynode tasktemplate interface #5479

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@
}

func (a *arrayTaskReader) Read(ctx context.Context) (*core.TaskTemplate, error) {
taskTemplate, err := a.TaskReader.Read(ctx)
originalTaskTemplate, err := a.TaskReader.Read(ctx)

Check warning on line 53 in flytepropeller/pkg/controller/nodes/array/node_execution_context.go

View check run for this annotation

Codecov / codecov/patch

flytepropeller/pkg/controller/nodes/array/node_execution_context.go#L53

Added line #L53 was not covered by tests
if err != nil {
return nil, err
}

// convert output list variable to singular
outputVariables := make(map[string]*core.Variable)
for key, value := range taskTemplate.Interface.Outputs.Variables {
for key, value := range originalTaskTemplate.Interface.Outputs.Variables {

Check warning on line 60 in flytepropeller/pkg/controller/nodes/array/node_execution_context.go

View check run for this annotation

Codecov / codecov/patch

flytepropeller/pkg/controller/nodes/array/node_execution_context.go#L60

Added line #L60 was not covered by tests
switch v := value.Type.Type.(type) {
case *core.LiteralType_CollectionType:
outputVariables[key] = &core.Variable{
Expand All @@ -69,10 +69,14 @@
}
}

taskTemplate.Interface.Outputs = &core.VariableMap{
Variables: outputVariables,
taskTemplate := *originalTaskTemplate
taskTemplate.Interface = &core.TypedInterface{
Inputs: originalTaskTemplate.Interface.Inputs,
Outputs: &core.VariableMap{
Variables: outputVariables,
},

Check warning on line 77 in flytepropeller/pkg/controller/nodes/array/node_execution_context.go

View check run for this annotation

Codecov / codecov/patch

flytepropeller/pkg/controller/nodes/array/node_execution_context.go#L72-L77

Added lines #L72 - L77 were not covered by tests
}
return taskTemplate, nil
return &taskTemplate, nil

Check warning on line 79 in flytepropeller/pkg/controller/nodes/array/node_execution_context.go

View check run for this annotation

Codecov / codecov/patch

flytepropeller/pkg/controller/nodes/array/node_execution_context.go#L79

Added line #L79 was not covered by tests
}

type arrayNodeExecutionContext struct {
Expand Down
Loading