Skip to content

Commit 4238cb2

Browse files
committed
Add logic for decoding attr.string_keyed_label_dict()
1 parent ae884cd commit 4238cb2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

pkg/model/starlark/encode_compiled_program.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,16 @@ func DecodeAttrType[TReference object.BasicReference, TMetadata model_core.Refer
842842
return NewStringAttrType[TReference, TMetadata](attrTypeInfo.String_.Values), nil
843843
case *model_starlark_pb.Attr_StringDict:
844844
return NewStringDictAttrType[TReference, TMetadata](), nil
845+
case *model_starlark_pb.Attr_StringKeyedLabelDict:
846+
if attrTypeInfo.StringKeyedLabelDict.DictValueOptions == nil || attrTypeInfo.StringKeyedLabelDict.DictValueOptions.Cfg == nil {
847+
return nil, errors.New("missing dict value options")
848+
}
849+
return NewStringKeyedLabelDictAttrType[TReference, TMetadata](
850+
attrTypeInfo.StringKeyedLabelDict.DictValueOptions.AllowFiles,
851+
NewProtoTransitionDefinition[TReference, TMetadata](
852+
model_core.Nested(attr, attrTypeInfo.StringKeyedLabelDict.DictValueOptions.Cfg),
853+
),
854+
), nil
845855
case *model_starlark_pb.Attr_StringList:
846856
return NewStringListAttrType[TReference, TMetadata](), nil
847857
case *model_starlark_pb.Attr_StringListDict:

0 commit comments

Comments
 (0)