-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add explanation metadata get_metadata_protobuf
for reuse
#672
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
@@ -28,3 +28,7 @@ class MetadataBuilder(_ABC): | |||
@abc.abstractmethod | |||
def get_metadata(self): | |||
"""Returns the current metadata as a dictionary.""" | |||
|
|||
@abc.abstractmethod | |||
def get_metadata_object(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, changed to get_metadata_protobuf
get_metadata_protobuf
for reuse
/LGTM |
Add a explanationMetadata Object for re-use.