We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using timedelta with explicitly setting the seconds to 0 the output is empty instead of being explicitly set
>>> from datetime import timedelta >>> from dataclasses import dataclass >>> import betterproto >>> >>> @dataclass(eq=False, repr=False) ... class TestTimeout(betterproto.Message): ... timeout: timedelta = betterproto.message_field(1) ... >>> TestTimeout(timeout=timedelta(seconds=0)).to_dict() {} >>> from datetime import timedelta >>> from dataclasses import dataclass >>> import betterproto >>> >>> @dataclass(eq=False, repr=False) ... class TestTimeout(betterproto.Message): ... timeout: timedelta = betterproto.message_field(1) ... >>> TestTimeout(timeout=timedelta(seconds=1)).to_dict() {'timeout': '1.000s'}
Output expected to be {'timeout': '0s'}
{'timeout': '0s'}
Output is an empty dict {}
betterproto==2.0.0b6
python 3.11
pip install -U --pre betterproto
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Summary
When using timedelta with explicitly setting the seconds to 0 the output is empty instead of being explicitly set
Reproduction Steps
Expected Results
Output expected to be
{'timeout': '0s'}
Actual Results
Output is an empty dict {}
System Information
betterproto==2.0.0b6
python 3.11
Checklist
pip install -U --pre betterproto
, if possible.The text was updated successfully, but these errors were encountered: