Skip to content

Commit

Permalink
Version 5.3.0 - Support for Structs
Browse files Browse the repository at this point in the history
### Added

- Support for the `google.protobuf.Value` message
  • Loading branch information
CCP-Zeulix committed Sep 24, 2024
1 parent 374d8fe commit 373f620
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions protoplasm/casting/dictator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ def dataclass_to_dict(dc) -> Dict:
d = {}
for field in dataclasses.fields(dc):
dicted = _dataclass_field_to_dict_field(field, dc)
# if dicted:
# if dicted is not None: # TODO(thordurm@ccpgames.com>) 2024-04-15: To include "default/empty" fields or not?
if dicted is not ...:
d[_get_proto_field_name(field)] = dicted

Expand Down
2 changes: 1 addition & 1 deletion tests/test_dictator.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def test_dataclass_to_dict(self):
'simple_map': {'dora': 'Imamap!',
'diego': 'Camera!'},
'message_map': {'mickey': {'foo': 'mouse',
'bar': ''}, # TODO(thordurm@ccpgames.com>) 2024-04-15: Should we include "default/empty" values?!?
'bar': ''},
'donald': {'foo': 'duck',
'bar': 'trump'}}}

Expand Down

0 comments on commit 373f620

Please sign in to comment.