libprotoc 3.12.4
Python 3.10.12
Name: betterproto
Version: 1.2.5
Summary: A better Protobuf / gRPC generator & library
Home-page: http://github.com/danielgtaylor/python-betterproto
Author: Daniel G. Taylor
Author-email: danielgtaylor@gmail.com
License: MIT
Location: /home/durachok/PycharmProjects/asdasddasd/.venv/lib/python3.10/site-packages
Requires: grpclib, stringcase
Required-by:
Checklist
[X] I have searched the issues for duplicates.
[X] I have shown the entire traceback, if possible.
[X] I have verified this issue occurs on the latest prelease of betterproto which can be installed using pip install -U --pre betterproto, if possible.
Summary
simple structs not parsing
Reproduction Steps
@dataclass class GameMessage(betterproto.Message): """Общий формат любого UDP-сообщения"""
@dataclass class GameMessageAckMsg(betterproto.Message): pass
msg = GameMessage(ack=GameMessageAckMsg(), sender_id=3) serialized = bytes(msg) deserialized = GameMessage().parse(serialized) print(betterproto.which_one_of(deserialized, "Type"))
Expected Results
(''ack", None)
Actual Results
('', None)
System Information
libprotoc 3.12.4 Python 3.10.12 Name: betterproto Version: 1.2.5 Summary: A better Protobuf / gRPC generator & library Home-page: http://github.com/danielgtaylor/python-betterproto Author: Daniel G. Taylor Author-email: danielgtaylor@gmail.com License: MIT Location: /home/durachok/PycharmProjects/asdasddasd/.venv/lib/python3.10/site-packages Requires: grpclib, stringcase Required-by:
Checklist
pip install -U --pre betterproto
, if possible.