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

fix: Message.to_pydict and .from_pydict #609

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

RF-Tar-Railt
Copy link

@RF-Tar-Railt RF-Tar-Railt commented Sep 6, 2024

Summary

resolve #610

Just one line different:

  • to_dict:
try:
    value = getattr(self, field_name)
except AttributeError:
    value = self._get_field_default(field_name)
cased_name = casing(field_name).rstrip("_")  # type: ignore
  • to_pydict:
value = getattr(self, field_name)
cased_name = casing(field_name).rstrip("_")  # type: ignore

from_pydict is the same cause.

Checklist

  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
    • This change has an associated test.
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@Gobot1234
Copy link
Collaborator

What is this fixing? Please can you also provide tests so that this doesn't happen in the future

@RF-Tar-Railt
Copy link
Author

What is this fixing? Please can you also provide tests so that this doesn't happen in the future

updated

@RF-Tar-Railt RF-Tar-Railt marked this pull request as ready for review September 6, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Message with oneof called method .to_pydict/.from_pydict fails
2 participants