Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Sep 25, 2024
1 parent c8429fa commit 455d50c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion flytepropeller/pkg/compiler/errors/compiler_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestErrorCodes(t *testing.T) {
UnrecognizedValue: NewUnrecognizedValueErr("", ""),
WorkflowBuildError: NewWorkflowBuildError(errors.New("")),
NoNodesFound: NewNoNodesFoundErr(""),
InvalidLiteralTypeError: NewInvalidLiteralTypeErr("", ""),
InvalidLiteralTypeError: NewInvalidLiteralTypeErr("", "", errors.New("")),
}

for key, value := range testCases {
Expand Down
4 changes: 2 additions & 2 deletions flytepropeller/pkg/compiler/errors/compiler_errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ func NewMismatchingVariablesErr(nodeID, fromVar, fromType, toVar, toType string)
)
}

func NewInvalidLiteralTypeErr(nodeID, errMsg string) *CompileError {
func NewInvalidLiteralTypeErr(nodeID, inputVar string, err error) *CompileError {
return newError(
InvalidLiteralTypeError,
errMsg,
fmt.Sprintf("Failed to validate literal type for [%s] with err: %s", inputVar, err),
nodeID,
)
}
Expand Down
5 changes: 1 addition & 4 deletions flytepropeller/pkg/compiler/transformers/k8s/inputs.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package k8s

import (
"fmt"

"k8s.io/apimachinery/pkg/util/sets"

"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
Expand Down Expand Up @@ -47,8 +45,7 @@ func validateInputs(nodeID common.NodeID, iface *core.TypedInterface, inputs cor

err := validators.ValidateLiteralType(inputType)
if err != nil {
errMsg := fmt.Sprintf("Failed to validate literal type for [%s] with err: %s", inputVar, err)
errs.Collect(errors.NewInvalidLiteralTypeErr(nodeID, errMsg))
errs.Collect(errors.NewInvalidLiteralTypeErr(nodeID, inputVar, err))
continue
}

Expand Down

0 comments on commit 455d50c

Please sign in to comment.