|
15 | 15 | JsonObject = Any |
16 | 16 |
|
17 | 17 |
|
| 18 | +# TODO: These methods need to be updated when bumping the version of protobuf. |
| 19 | +# https://github.com/feast-dev/feast/issues/2484 |
18 | 20 | def _patch_proto_json_encoding( |
19 | 21 | proto_type: Type[ProtoMessage], |
20 | 22 | to_json_object: Callable[[_Printer, ProtoMessage], JsonObject], |
@@ -68,7 +70,7 @@ def to_json_object(printer: _Printer, message: ProtoMessage) -> JsonObject: |
68 | 70 | return value |
69 | 71 |
|
70 | 72 | def from_json_object( |
71 | | - parser: _Parser, value: JsonObject, message: ProtoMessage |
| 73 | + parser: _Parser, value: JsonObject, message: ProtoMessage, |
72 | 74 | ) -> None: |
73 | 75 | if value is None: |
74 | 76 | message.null_val = 0 |
@@ -140,7 +142,7 @@ def to_json_object(printer: _Printer, message: ProtoMessage) -> JsonObject: |
140 | 142 | return [printer._MessageToJsonObject(item) for item in message.val] |
141 | 143 |
|
142 | 144 | def from_json_object( |
143 | | - parser: _Parser, value: JsonObject, message: ProtoMessage |
| 145 | + parser: _Parser, value: JsonObject, message: ProtoMessage, |
144 | 146 | ) -> None: |
145 | 147 | array = value if isinstance(value, list) else value["val"] |
146 | 148 | for item in array: |
@@ -181,7 +183,7 @@ def to_json_object(printer: _Printer, message: ProtoMessage) -> JsonObject: |
181 | 183 | return list(message.val) |
182 | 184 |
|
183 | 185 | def from_json_object( |
184 | | - parser: _Parser, value: JsonObject, message: ProtoMessage |
| 186 | + parser: _Parser, value: JsonObject, message: ProtoMessage, |
185 | 187 | ) -> None: |
186 | 188 | array = value if isinstance(value, list) else value["val"] |
187 | 189 | message.val.extend(array) |
|
0 commit comments