From d5d7b798155356ca77e5cce1267ae0d9945b1b20 Mon Sep 17 00:00:00 2001 From: Future-Outlier Date: Thu, 8 Aug 2024 18:52:27 +0800 Subject: [PATCH] fix attribute access for nested dict/dataclass Signed-off-by: Future-Outlier --- .../pkg/controller/nodes/attr_path_resolver.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/flytepropeller/pkg/controller/nodes/attr_path_resolver.go b/flytepropeller/pkg/controller/nodes/attr_path_resolver.go index 79d6ef8b6f..204b0d7190 100644 --- a/flytepropeller/pkg/controller/nodes/attr_path_resolver.go +++ b/flytepropeller/pkg/controller/nodes/attr_path_resolver.go @@ -174,14 +174,20 @@ func convertInterfaceToLiteral(nodeID string, obj interface{}) (*core.Literal, e switch obj := obj.(type) { case map[string]interface{}: - newSt, err := structpb.NewStruct(obj) + jsonBytes, err := json.Marshal(obj) + if err != nil { + return nil, err + } + jsonBytes, err = msgpack.Marshal(jsonBytes) if err != nil { return nil, err } literal.Value = &core.Literal_Scalar{ Scalar: &core.Scalar{ - Value: &core.Scalar_Generic{ - Generic: newSt, + Value: &core.Scalar_Json{ + Json: &core.Json{ + Value: jsonBytes, + }, }, }, }