You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this situation, it is expected for the two calls to work without error.
Actual Results
The call to to_dict works as expected: it prints {'ts': ['2015-03-05T00:00:00Z']}. However, the call to to_pydict fails with the error: AttributeError: 'datetime.datetime' object has no attribute 'to_pydict'.
It is possible to simply fix this bug (and the related bugs) by patching the to_pydict function, but it might be easier with a bit of refactoring first. I will probably be able to work on this once my other PRs are approved.
System Information
libprotoc 3.12.4
Python 3.12.5
Name: betterproto
Version: 2.0.0b7
Summary: A better Protobuf / gRPC generator & library
Home-page: https://github.com/danielgtaylor/python-betterproto
Author: Daniel G. Taylor
Author-email: [email protected]
License: MIT
Location: XXX/.venv/lib/python3.12/site-packages
Requires: grpclib, python-dateutil, typing-extensions
Required-by: pygrpc-poc
Checklist
I have searched the issues for duplicates.
I have shown the entire traceback, if possible.
I have verified this issue occurs on the latest prelease of betterproto which can be installed using pip install -U --pre betterproto, if possible.
The text was updated successfully, but these errors were encountered:
When calling the
to_pydict
method on a message which has a repeated timestamp field, anAttributeError
is raised.Reproduction Steps
Compile the following message :
Then, execute the following code:
Expected Results
In this situation, it is expected for the two calls to work without error.
Actual Results
The call to
to_dict
works as expected: it prints{'ts': ['2015-03-05T00:00:00Z']}
. However, the call toto_pydict
fails with the error:AttributeError: 'datetime.datetime' object has no attribute 'to_pydict'
.It is possible to simply fix this bug (and the related bugs) by patching the
to_pydict
function, but it might be easier with a bit of refactoring first. I will probably be able to work on this once my other PRs are approved.System Information
libprotoc 3.12.4
Python 3.12.5
Name: betterproto
Version: 2.0.0b7
Summary: A better Protobuf / gRPC generator & library
Home-page: https://github.com/danielgtaylor/python-betterproto
Author: Daniel G. Taylor
Author-email: [email protected]
License: MIT
Location: XXX/.venv/lib/python3.12/site-packages
Requires: grpclib, python-dateutil, typing-extensions
Required-by: pygrpc-poc
Checklist
pip install -U --pre betterproto
, if possible.The text was updated successfully, but these errors were encountered: