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: correctly decode falsy values in legacy protocol buffers #628

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

chrisrossi
Copy link
Contributor

Fixes #625

@chrisrossi chrisrossi requested a review from a team April 8, 2021 17:18
@product-auto-label product-auto-label bot added the api: datastore Issues related to the googleapis/python-ndb API. label Apr 8, 2021
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Apr 8, 2021
@chrisrossi
Copy link
Contributor Author

This is a pretty good object lesson on why the old expr and truthy_value or falsy_value way of faking a ternary operator is a pretty bad construct. What you want is to get truthy_value or falsy_value based only on the evaluation of expr, but in this case, if truthy_value is falsy you get falsy_value regardless of how expr evaluates.

Converting to the native Python ternary operator construct fixes this.

@crwilcox crwilcox merged commit 69a9f63 into googleapis:master Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the googleapis/python-ndb API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saved Appengine model: boolean attributes interpreted as None
2 participants