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
{{ message }}
This repository was archived by the owner on Feb 23, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 23, 2026. It is now read-only.
Similar to #151, it would be quite useful to be able to parse a message from a JSON-representation dictionary.
Currently, in https://github.com/googleapis/python-bigquery/pull/332/files we need to deserialize the response to a dictionary because of how the handwritten clients are structured, but then immediately re-serialize the response to a JSON string so that we can call from_json.
Activity
software-dov commentedon Oct 19, 2020
Effective duplicate of #151 lumping in under that.
software-dov commentedon Oct 19, 2020
The message constructor allows just passing in a dict; it already does all the heavy lifting.
E.g.
tswast commentedon Oct 19, 2020
Does this work with nested message? I recall in the monolith it didn't work the same as the parse from dict method.
busunkim96 commentedon Oct 19, 2020
@tswast It should work. This is what allows
requestto be passed as a dict to the service methods. This KMS sample has some nesting: https://github.com/googleapis/python-kms/blob/c349e3efa0b6cf5dbb9043043310ef5fac0fccc5/samples/snippets/update_key_add_rotation.py#L43-L57Ark-kun commentedon Dec 5, 2022
That constructor is incompatible with
message.to_dictand the actual REST API payloads. Meanwhile,.from_jsonis compatible with.to_jsonThis works:
This does not work: