protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Add in patchable _INT64_CONVERTER

Open mikedh opened this issue 1 year ago • 2 comments

An alternative to https://github.com/protocolbuffers/protobuf/pull/16130, which I presume was rejected because you would also have to contribute the option to the mapping specification for every language, add a bunch of tests, etc.

The pitch here: outputting int64 as a string produces results that are defensible as a mapping, but not great for a consumer ("why are my numbers, strings?"). This PR modifies no existing logic, but allows an upstream user who knows what they want to in-place patch the json_format.py without vendoring the entire json_format submodule:

from google.protobuf import json_format

assert json_format._INT64_CONVERTER == str
json_format._INT64_CONVERTER = int

mikedh avatar Aug 14 '24 20:08 mikedh

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Aug 14 '24 20:08 google-cla[bot]

Hey @anandolee the CLA check is now passing thanks!

mikedh avatar Aug 17 '24 19:08 mikedh

We triage inactive PRs and issues in order to make it easier to find active work. If this PR should remain active, please add a comment.

This PR is labeled inactive because the last activity was over 90 days ago. This PR will be closed and archived after 14 additional days without activity.

github-actions[bot] avatar Jan 10 '25 10:01 github-actions[bot]

We triage inactive PRs and issues in order to make it easier to find active work. If this PR should remain active or becomes active again, please reopen it.

This PR was closed and archived because there has been no new activity in the 14 days since the inactive label was added.

github-actions[bot] avatar Jan 25 '25 10:01 github-actions[bot]