File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,8 @@ def dict_to_struct(d: dict) -> structpb.Struct:
63
63
return s
64
64
65
65
66
- def __to_python_native (v : structpb .Value ) -> Any :
67
- """Convert a protobuf Value to a Python native type."""
66
+ def __to_python_builtin (v : structpb .Value ) -> Any :
67
+ """Convert a protobuf Value to a Python builtin type."""
68
68
if isinstance (v , structpb .ListValue ):
69
69
return __listvalue_to_list (v )
70
70
elif isinstance (v , structpb .Struct ):
@@ -74,7 +74,7 @@ def __to_python_native(v: structpb.Value) -> Any:
74
74
75
75
def __listvalue_to_list (lv : structpb .ListValue ) -> list :
76
76
"""Convert a protobuf ListValue to a list."""
77
- return [__to_python_native (v ) for v in lv ]
77
+ return [__to_python_builtin (v ) for v in lv ]
78
78
79
79
80
80
def struct_to_dict (s : structpb .Struct ) -> dict :
@@ -84,7 +84,7 @@ def struct_to_dict(s: structpb.Struct) -> dict:
84
84
protobuf struct. This function makes it possible to convert resources to a
85
85
dictionary.
86
86
"""
87
- return {k : __to_python_native (v ) for k , v in s .items ()}
87
+ return {k : __to_python_builtin (v ) for k , v in s .items ()}
88
88
89
89
90
90
@dataclasses .dataclass
You can’t perform that action at this time.
0 commit comments