feat: add explanation metadata get_metadata_protobuf for reuse#672
feat: add explanation metadata get_metadata_protobuf for reuse#672ji-yaqi merged 5 commits intogoogleapis:mainfrom
get_metadata_protobuf for reuse#672Conversation
sasha-gitg
left a comment
There was a problem hiding this comment.
Changing the return type on get_metadata is a breaking change. Preference to avoid it if possible.
Another potential solution is expanding the explain parameters to accept a Union of Dict and Explain protos and handling the conversion underneath.
Proto plus seems to be able to accept dictionaries of representation at construction time: https://github.com/googleapis/proto-plus-python/blob/cfd5b6caca3fa9add89d8c69ea620505dd90dd7c/docs/messages.rst#serialization
What is the exception that is thrown if the dictionary representation is passed in?
I think we are not changing the return type on |
|
Got it. Disregard the breaking change statement. Would like to follow up on the exception thrown when passing the dictionary instead of the proto. |
I got the following: |
| """Returns the current metadata as a dictionary.""" | ||
|
|
||
| @abc.abstractmethod | ||
| def get_metadata_object(self): |
There was a problem hiding this comment.
It seems like this can be informative if further qualified as get_metadata_protobuf or get_metadata_pb.
There was a problem hiding this comment.
Thanks, changed to get_metadata_protobuf
get_metadata_protobuf for reuse
|
/LGTM |
Add a explanationMetadata Object for re-use.