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
Compressed JsonProperty within a repeated StructuredProperty raises AttributError #817
Labels
api: datastore
Issues related to the googleapis/python-ndb API.
Comments
product-auto-label
bot
added
the
api: datastore
Issues related to the googleapis/python-ndb API.
label
Oct 25, 2022
sorced-jim
added a commit
that referenced
this issue
Feb 29, 2024
…y_data (#817) (#946) * Fix issue 817 * Fix issue 817 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: venticello <[email protected]> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Jim Morrison <[email protected]>
Fixed in google-cloud-ndb==2.3.0 |
Based on my initial testing, this does seem to be fixed in 2.3.0 and 2.3.1. (Although we can't upgrade until this version of NDB can properly work with our test suite. It can't be used with the datastore emulator, and the firestore emulator lacks some fairly critical features of the datastore emulator at this time.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While converting a complex AppEngine code base from python 2.7 to python 3.x, I ran into an unexpected bug in the new google.cloud.ndb that does not exist in the legacy google.appengine.ext.ndb.
Environment details
python-ndb 1.11.1
Python 2.7.18
Discovered and tested on MacOS 12.6
Steps to reproduce
See the toy example below. But to summarize: A repeated StructuredProperty that contains a compressed JsonProperty field. The bug probably apples to other property types that inherit from BlobProperty.
Code example
Stack trace
Possible fix?
The exception actually happens in BlobProperty._to_datastore, but under python 2.7 the stack trace doesn't show the original stack trace. If I understand that method properly, it checks
self._repeated
, but it neglects therepeated
input argument when determining how to mutate or read thedata
dict that it is constructing for datastore. The exception is raised because the field itself is notself._repeated
, but it is part of a repeated StructuredProperty.The text was updated successfully, but these errors were encountered: