diff --git a/flytestdlib/utils/pretty_print.go b/flytepropeller/pkg/compiler/common/pretty_print.go similarity index 97% rename from flytestdlib/utils/pretty_print.go rename to flytepropeller/pkg/compiler/common/pretty_print.go index 8b7b669061..6ff696e9b5 100644 --- a/flytestdlib/utils/pretty_print.go +++ b/flytepropeller/pkg/compiler/common/pretty_print.go @@ -1,4 +1,4 @@ -package utils +package common import ( "fmt" diff --git a/flytestdlib/utils/pretty_print_test.go b/flytepropeller/pkg/compiler/common/pretty_print_test.go similarity index 97% rename from flytestdlib/utils/pretty_print_test.go rename to flytepropeller/pkg/compiler/common/pretty_print_test.go index bc31666a9e..4f83961c70 100644 --- a/flytestdlib/utils/pretty_print_test.go +++ b/flytepropeller/pkg/compiler/common/pretty_print_test.go @@ -1,4 +1,4 @@ -package utils +package common import ( "testing" diff --git a/flytepropeller/pkg/compiler/transformers/k8s/inputs.go b/flytepropeller/pkg/compiler/transformers/k8s/inputs.go index 72850c8224..2b94570c20 100644 --- a/flytepropeller/pkg/compiler/transformers/k8s/inputs.go +++ b/flytepropeller/pkg/compiler/transformers/k8s/inputs.go @@ -7,7 +7,6 @@ import ( "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/validators" - "github.com/flyteorg/flyte/flytestdlib/utils" ) func validateInputs(nodeID common.NodeID, iface *core.TypedInterface, inputs core.LiteralMap, errs errors.CompileErrors) (ok bool) { @@ -43,7 +42,7 @@ func validateInputs(nodeID common.NodeID, iface *core.TypedInterface, inputs cor continue } if !validators.AreTypesCastable(inputType, v.Type) { - errs.Collect(errors.NewMismatchingTypesErr(nodeID, inputVar, utils.LiteralTypeToStr(v.Type), utils.LiteralTypeToStr(inputType))) + errs.Collect(errors.NewMismatchingTypesErr(nodeID, inputVar, common.LiteralTypeToStr(v.Type), common.LiteralTypeToStr(inputType))) continue } diff --git a/flytepropeller/pkg/compiler/validators/bindings.go b/flytepropeller/pkg/compiler/validators/bindings.go index ff675733dc..b69dda529f 100644 --- a/flytepropeller/pkg/compiler/validators/bindings.go +++ b/flytepropeller/pkg/compiler/validators/bindings.go @@ -10,7 +10,6 @@ import ( c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/typing" - "github.com/flyteorg/flyte/flytestdlib/utils" ) func validateBinding(w c.WorkflowBuilder, node c.Node, nodeParam string, binding *flyte.BindingData, @@ -132,7 +131,7 @@ func validateBinding(w c.WorkflowBuilder, node c.Node, nodeParam string, binding // If the variable has an index. We expect param to be a collection. if v.Index != nil { if cType := param.GetType().GetCollectionType(); cType == nil { - errs.Collect(errors.NewMismatchingVariablesErr(nodeID, outputVar, utils.LiteralTypeToStr(param.Type), inputVar, utils.LiteralTypeToStr(expectedType))) + errs.Collect(errors.NewMismatchingVariablesErr(nodeID, outputVar, c.LiteralTypeToStr(param.Type), inputVar, c.LiteralTypeToStr(expectedType))) } else { sourceType = cType } @@ -165,7 +164,7 @@ func validateBinding(w c.WorkflowBuilder, node c.Node, nodeParam string, binding return param.GetType(), []c.NodeID{val.Promise.NodeId}, true } - errs.Collect(errors.NewMismatchingVariablesErr(node.GetId(), outputVar, utils.LiteralTypeToStr(sourceType), inputVar, utils.LiteralTypeToStr(expectedType))) + errs.Collect(errors.NewMismatchingVariablesErr(node.GetId(), outputVar, c.LiteralTypeToStr(sourceType), inputVar, c.LiteralTypeToStr(expectedType))) return nil, nil, !errs.HasErrors() } } @@ -181,7 +180,7 @@ func validateBinding(w c.WorkflowBuilder, node c.Node, nodeParam string, binding if literalType == nil { errs.Collect(errors.NewUnrecognizedValueErr(nodeID, reflect.TypeOf(val.Scalar.GetValue()).String())) } else if validateParamTypes && !AreTypesCastable(literalType, expectedType) { - errs.Collect(errors.NewMismatchingTypesErr(nodeID, nodeParam, utils.LiteralTypeToStr(literalType), utils.LiteralTypeToStr(expectedType))) + errs.Collect(errors.NewMismatchingTypesErr(nodeID, nodeParam, c.LiteralTypeToStr(literalType), c.LiteralTypeToStr(expectedType))) } if expectedType.GetEnumType() != nil { diff --git a/flytepropeller/pkg/compiler/validators/condition.go b/flytepropeller/pkg/compiler/validators/condition.go index 74cc9dba92..70b72cde8a 100644 --- a/flytepropeller/pkg/compiler/validators/condition.go +++ b/flytepropeller/pkg/compiler/validators/condition.go @@ -6,7 +6,6 @@ import ( flyte "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/flyteorg/flyte/flytestdlib/utils" ) func validateOperand(node c.NodeBuilder, paramName string, operand *flyte.Operand, @@ -45,7 +44,7 @@ func ValidateBooleanExpression(w c.WorkflowBuilder, node c.NodeBuilder, expr *fl if op1Valid && op2Valid && op1Type != nil && op2Type != nil { if op1Type.String() != op2Type.String() { errs.Collect(errors.NewMismatchingTypesErr(node.GetId(), "RightValue", - utils.LiteralTypeToStr(op1Type), utils.LiteralTypeToStr(op2Type))) + c.LiteralTypeToStr(op1Type), c.LiteralTypeToStr(op2Type))) } } } else if expr.GetConjunction() != nil { diff --git a/flytepropeller/pkg/compiler/validators/vars.go b/flytepropeller/pkg/compiler/validators/vars.go index d031c8fa1c..e114dc4fc0 100644 --- a/flytepropeller/pkg/compiler/validators/vars.go +++ b/flytepropeller/pkg/compiler/validators/vars.go @@ -4,7 +4,6 @@ import ( flyte "github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core" c "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/common" "github.com/flyteorg/flyte/flytepropeller/pkg/compiler/errors" - "github.com/flyteorg/flyte/flytestdlib/utils" ) func validateOutputVar(n c.NodeBuilder, paramName string, errs errors.CompileErrors) ( @@ -41,7 +40,7 @@ func validateInputVar(n c.NodeBuilder, paramName string, requireParamType bool, func validateVarType(nodeID c.NodeID, paramName string, param *flyte.Variable, expectedType *flyte.LiteralType, errs errors.CompileErrors) (ok bool) { if param.GetType().String() != expectedType.String() { - errs.Collect(errors.NewMismatchingTypesErr(nodeID, paramName, utils.LiteralTypeToStr(param.GetType()), utils.LiteralTypeToStr(expectedType))) + errs.Collect(errors.NewMismatchingTypesErr(nodeID, paramName, c.LiteralTypeToStr(param.GetType()), c.LiteralTypeToStr(expectedType))) } return !errs.HasErrors() diff --git a/flytestdlib/go.mod b/flytestdlib/go.mod index aa666174a3..c5c5e16604 100644 --- a/flytestdlib/go.mod +++ b/flytestdlib/go.mod @@ -9,7 +9,6 @@ require ( github.com/ernesto-jimenez/gogen v0.0.0-20180125220232-d7d4131e6607 github.com/fatih/color v1.13.0 github.com/fatih/structtag v1.2.0 - github.com/flyteorg/flyte/flyteidl v0.0.0-00010101000000-000000000000 github.com/flyteorg/stow v0.3.10 github.com/fsnotify/fsnotify v1.6.0 github.com/ghodss/yaml v1.0.0 @@ -154,7 +153,6 @@ require ( replace ( github.com/flyteorg/flyte/datacatalog => ../datacatalog github.com/flyteorg/flyte/flyteadmin => ../flyteadmin - github.com/flyteorg/flyte/flyteidl => ../flyteidl github.com/flyteorg/flyte/flyteplugins => ../flyteplugins github.com/flyteorg/flyte/flytepropeller => ../flytepropeller github.com/flyteorg/flyte/flytestdlib => ../flytestdlib diff --git a/go.mod b/go.mod index 80d35f3114..fd2432e987 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,6 @@ require ( github.com/flyteorg/flyte/flyteadmin v0.0.0-00010101000000-000000000000 github.com/flyteorg/flyte/flytepropeller v0.0.0-00010101000000-000000000000 github.com/flyteorg/flyte/flytestdlib v0.0.0-00010101000000-000000000000 - github.com/flyteorg/flytectl v0.0.0-00010101000000-000000000000 github.com/golang/glog v1.2.0 github.com/prometheus/client_golang v1.20.5 github.com/spf13/cobra v1.7.0 @@ -25,7 +24,7 @@ require ( cloud.google.com/go/storage v1.36.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azcore v1.13.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.7.0 // indirect - github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect + github.com/Azure/azure-sdk--forgo/sdk/internal v1.10.0 // indirect github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect @@ -291,7 +290,6 @@ replace ( github.com/flyteorg/flyte/flyteplugins => ./flyteplugins github.com/flyteorg/flyte/flytepropeller => ./flytepropeller github.com/flyteorg/flyte/flytestdlib => ./flytestdlib - github.com/flyteorg/flytectl => ./flytectl github.com/google/gnostic-models => github.com/google/gnostic-models v0.6.8 github.com/robfig/cron/v3 => github.com/unionai/cron/v3 v3.0.2-0.20220915080349-5790c370e63a k8s.io/api => k8s.io/api v0.28.2