Skip to content

Commit

Permalink
fix merge
Browse files Browse the repository at this point in the history
Signed-off-by: Mecoli1219 <[email protected]>
  • Loading branch information
Mecoli1219 committed Nov 13, 2024
1 parent aafb36f commit 715d830
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 10 additions & 2 deletions flytepropeller/pkg/compiler/validators/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ func (t collectionInstanceChecker) isInstance(lit *core.Literal) bool {
return false
}
for _, x := range lit.GetCollection().Literals {
if !IsInstance(x, t.literalType.GetCollectionType()) {
if _, ok := x.GetValue().(*core.Literal_OffloadedMetadata); ok {
if !AreTypesCastable(x.GetOffloadedMetadata().GetInferredType(), t.literalType) {
return false
}
} else if !IsInstance(x, t.literalType.GetCollectionType()) {
return false
}
}
Expand All @@ -249,7 +253,11 @@ func (t mapInstanceChecker) isInstance(lit *core.Literal) bool {
return false
}
for _, x := range lit.GetMap().Literals {
if !IsInstance(x, t.literalType.GetMapValueType()) {
if _, ok := x.GetValue().(*core.Literal_OffloadedMetadata); ok {
if !AreTypesCastable(x.GetOffloadedMetadata().GetInferredType(), t.literalType) {
return false
}
} else if !IsInstance(x, t.literalType.GetMapValueType()) {
return false
}
}
Expand Down
3 changes: 1 addition & 2 deletions flytepropeller/pkg/compiler/validators/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import (

"github.com/shamaton/msgpack/v2"
"github.com/stretchr/testify/assert"
"google.golang.org/protobuf/proto"

"github.com/flyteorg/flyte/flyteidl/clients/go/coreutils"
"github.com/flyteorg/flyte/flyteidl/gen/pb-go/flyteidl/core"
)

func TestLiteralTypeForLiterals(t *testing.T) {
func TestIsInstance(t *testing.T) {
t.Run("empty", func(t *testing.T) {
assert.True(t, IsInstance(nil, &core.LiteralType{
Type: &core.LiteralType_Simple{
Expand Down

0 comments on commit 715d830

Please sign in to comment.