Open TommyDew42 opened 1 year ago
Does it work to add an extra constructor to the Struct
class you pointed to? If so it could be a relatively simple change. If not it might be too complicated to implement.
yes that's the solution in my mind too 💯
We probably will not be able to prioritize this soon. Feel free to send a PR to implement it. If it works, we can review the API change internally and if we don't see any issues of concern, we can accept the PR.
Thanks. How do I run unittest locally?
Try: bazel test python/...
. You may want to create a venv first to ensure that protobuf isn't already installed in your local Python env:
$ python -m venv /tmp/venv
$ source /tmp/venv/bin/activate
$ bazel test python/...
What language does this apply to? python
Describe the problem you are trying to solve. When we initialise a Struct and want to set key-value pair on the struct, there are two steps:
Alternatively, we can also use
json_format.ParseDict
.Describe the solution you'd like Hopefully, we can do the following:
Describe alternatives you've considered
Additional context Add any other context or screenshots about the feature request here.