-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add additional parameters to
to_json()
and to_dict()
methods (
#384) * feat: Add additional parameters to `to_json()` and `to_dict()` methods - These parameters are just passthroughs to [`MessageToJson`][1] and [`MessageToDict`][2] [1]: https://googleapis.dev/python/protobuf/latest/google/protobuf/json_format.html#google.protobuf.json_format.MessageToJson [2]: https://googleapis.dev/python/protobuf/latest/google/protobuf/json_format.html#google.protobuf.json_format.MessageToDict * chore: Update min protobuf version to 3.20.0 to support `ensure_ascii` * Removed `ensure_ascii` to prevent version compatibility errors * Update proto/message.py Co-authored-by: Anthonios Partheniou <partheniou@google.com> * test: Add tests for `sort_keys` and `float_precision` * Fix test checks * Remove indent from float_precision test and add re.compile to sortkeys regex * Add spaces to float precision check, add dotall to sortkeys check * Remove indent from sort_keys test, add space to float precision test * Changed match to search * test: Add test for `to_dict()` with `float_precision` * Added TODOs for `float_precision` issue --------- Co-authored-by: Anthonios Partheniou <partheniou@google.com>
- Loading branch information
1 parent
9d52442
commit 8f13a46
Showing
3 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters