Skip to content
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: provide a to_dict method #154

Merged
merged 1 commit into from
Oct 19, 2020
Merged

feat: provide a to_dict method #154

merged 1 commit into from
Oct 19, 2020

Conversation

software-dov
Copy link
Contributor

Parallels the to_json method.
Also adds options to ignore unknown fields during deserializtion.

Closes #153
Closes #151

Parallels the `to_json` method.
Also adds options to ignore unknown fields during deserializtion.
@software-dov software-dov requested review from a team as code owners October 19, 2020 21:31
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 19, 2020
@software-dov software-dov added the automerge Merge the pull request once unit tests and other checks pass. label Oct 19, 2020
@codecov
Copy link

codecov bot commented Oct 19, 2020

Codecov Report

Merging #154 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #154   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines          856       863    +7     
  Branches       148       149    +1     
=========================================
+ Hits           856       863    +7     
Impacted Files Coverage Δ
proto/message.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd9003c...c0031e4. Read the comment docs.

@gcf-merge-on-green gcf-merge-on-green bot merged commit ccf903e into googleapis:master Oct 19, 2020
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Oct 19, 2020
@software-dov software-dov deleted the cerialization branch October 19, 2020 21:46
kwargs (dict): Keys and values corresponding to the fields of the
message.
"""

def __init__(self, mapping=None, **kwargs):
def __init__(self, mapping=None, *, ignore_unknown_fields=False, **kwargs):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide ignore_unknown_fields=True option in from_json and from_dict Provide a to_dict method
3 participants