Skip to content

Commit

Permalink
remove type
Browse files Browse the repository at this point in the history
Signed-off-by: pmahindrakar-oss <[email protected]>
  • Loading branch information
pmahindrakar-oss committed Sep 27, 2024
1 parent 5490b27 commit 2b96dd2
Show file tree
Hide file tree
Showing 22 changed files with 245 additions and 688 deletions.
29 changes: 14 additions & 15 deletions flyteidl/clients/go/coreutils/extract_literal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,25 +202,24 @@ func TestFetchLiteral(t *testing.T) {

t.Run("Offloaded metadata", func(t *testing.T) {
literalVal := "s3://blah/blah/blah"
var literalType = &core.LiteralType{
Type: &core.LiteralType_OffloadedType{
OffloadedType: &core.OffloadedType{
ActualLiteralType: &core.LiteralType{
Type: &core.LiteralType_CollectionType{
CollectionType: &core.LiteralType{
Type: &core.LiteralType_Simple{
Simple: core.SimpleType_INTEGER,
},
},
},
var storedLiteralType = &core.LiteralType{
Type: &core.LiteralType_CollectionType{
CollectionType: &core.LiteralType{
Type: &core.LiteralType_Simple{
Simple: core.SimpleType_INTEGER,
},
},
},
}
lit, err := MakeLiteralForType(literalType, literalVal)

assert.NoError(t, err)
extractedLiteralVal, err := ExtractFromLiteral(lit)
offloadedLiteral := &core.Literal{
Value: &core.Literal_OffloadedMetadata{
OffloadedMetadata: &core.LiteralOffloadedMetadata{
Uri: literalVal,
InferredType: storedLiteralType,
},
},
}
extractedLiteralVal, err := ExtractFromLiteral(offloadedLiteral)
assert.NoError(t, err)
assert.Equal(t, literalVal, extractedLiteralVal)
})
Expand Down
8 changes: 0 additions & 8 deletions flyteidl/clients/go/coreutils/literals.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,14 +636,6 @@ func MakeLiteralForType(t *core.LiteralType, v interface{}) (*core.Literal, erro
if !found {
return nil, fmt.Errorf("incorrect union value [%s], supported values %+v", v, newT.UnionType.Variants)
}
case *core.LiteralType_OffloadedType:
// This is a special type that is used to represent a literal that is offloaded to a remote store.
// The value here is the URI of the offloaded data.
l.Value = &core.Literal_OffloadedMetadata{
OffloadedMetadata: &core.LiteralOffloadedMetadata{
Uri: fmt.Sprintf("%v", v),
},
}
default:
return nil, fmt.Errorf("unsupported type %s", t.String())
}
Expand Down
50 changes: 0 additions & 50 deletions flyteidl/gen/pb-es/flyteidl/core/types_pb.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2b96dd2

Please sign in to comment.