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

StructuredProperty backward compatibility issue #122

Closed
alexrwix opened this issue Jun 25, 2019 · 0 comments · Fixed by #126
Closed

StructuredProperty backward compatibility issue #122

alexrwix opened this issue Jun 25, 2019 · 0 comments · Fixed by #126
Assignees
Labels
🚨 This issue needs some love. status: investigating The issue is under investigation, which is determined to be non-trivial. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@alexrwix
Copy link
Contributor

We are porting our py27 GAE project to py37 GAE and replacing built-in services to their gcloud library counterparts.

During writing exploration tests for python-ndb we found that py27 ndb and py37 ndb storing StructuredProperties in different ways.

As we can see in google cloud console datastore viewer py37 python-ndb saving StructuredProperty as single property with embedded entity type .
image

In py27 ndb StructuredProperty was stored as multiple dot separated properties (one for each StructuredProperty internal model property)
image

As a result, python-ndb loading existing models without "2.7 ndb stored" StructuredProperties.

Do you plan to make StructuredProperty backward compatible?

@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Jun 26, 2019
@chrisrossi chrisrossi added 🚨 This issue needs some love. and removed triage me I really want to be triaged. labels Jun 26, 2019
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Jun 26, 2019
@chrisrossi chrisrossi self-assigned this Jun 27, 2019
chrisrossi pushed a commit to chrisrossi/python-ndb that referenced this issue Jun 27, 2019
When implementing structured properties the first time, I just used
Datastore's native embedded entity functionality, not realizing that NDB
had originally used dotted property names instead. (Probably GAE
Datastore didn't have embedded entities when NDB was originally
written.) The problem is that users migrating from GAE NDB can't load
entities with structured properties from their existing datastore. This
PR makes NDB backwards compatible with older, dotted name style
structured properties so that existing repositories still work with the
new NDB.

Fixes googleapis#122.
chrisrossi pushed a commit to chrisrossi/python-ndb that referenced this issue Jun 28, 2019
When implementing structured properties the first time, I just used
Datastore's native embedded entity functionality, not realizing that NDB
had originally used dotted property names instead. (Probably GAE
Datastore didn't have embedded entities when NDB was originally
written.) The problem is that users migrating from GAE NDB can't load
entities with structured properties from their existing datastore. This
PR makes NDB backwards compatible with older, dotted name style
structured properties so that existing repositories still work with the
new NDB.

Fixes googleapis#122.
chrisrossi pushed a commit that referenced this issue Jun 28, 2019
When implementing structured properties the first time, I just used
Datastore's native embedded entity functionality, not realizing that NDB
had originally used dotted property names instead. (Probably GAE
Datastore didn't have embedded entities when NDB was originally
written.) The problem is that users migrating from GAE NDB can't load
entities with structured properties from their existing datastore. This
PR makes NDB backwards compatible with older, dotted name style
structured properties so that existing repositories still work with the
new NDB.

Fixes #122.
@yoshi-automation yoshi-automation added the 🚨 This issue needs some love. label Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. status: investigating The issue is under investigation, which is determined to be non-trivial. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants