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

Read legacy data with Repeated Structured Expando properties. #176

Conversation

chrisrossi
Copy link
Contributor

Fixes #129.

@chrisrossi chrisrossi requested a review from cguardia August 28, 2019 13:47
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 28, 2019
@chrisrossi chrisrossi force-pushed the repeated-structured-expando-properties branch from 4ff9545 to 09cee76 Compare August 28, 2019 14:01
Copy link
Contributor

@cguardia cguardia left a comment

Choose a reason for hiding this comment

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

Very good.

@chrisrossi chrisrossi merged commit 0f09e9a into googleapis:master Aug 28, 2019
@chrisrossi chrisrossi deleted the repeated-structured-expando-properties branch August 28, 2019 19:39
rwhogg added a commit to rwhogg/python-ndb that referenced this pull request Nov 14, 2022
Legacy NDB had a bug where, with repeated Expando properties, it could
end up writing arrays of different length if some entities had missing
values for certain subproperties. When Cloud NDB read this out, it might
have only loaded entities corresponding to the shorter array length.
See issue googleapis#129 .

To fix this, with PR googleapis#176 , we made Cloud NDB check if there are length
differences and pad out the array as necessary.

However, depending on the order properties are returned from Datastore in,
we may have accidentally padded with subentities of the wrong kind,
because it was possible to skip over updating the kind if we alternated
between updating repeated properties.

(Eg: A.a with 2 elements, B.b with 3 elements, A.c with 3 elements ->
A would end up with an element of B's kind)
rwhogg added a commit to rwhogg/python-ndb that referenced this pull request Nov 14, 2022
Legacy NDB had a bug where, with repeated Expando properties, it could
end up writing arrays of different length if some entities had missing
values for certain subproperties. When Cloud NDB read this out, it might
have only loaded entities corresponding to the shorter array length.
See issue googleapis#129 .

To fix this, with PR googleapis#176 , we made Cloud NDB check if there are length
differences and pad out the array as necessary.

However, depending on the order properties are returned from Datastore in,
we may have accidentally padded with subentities of the wrong kind,
because it was possible to skip over updating the kind if we alternated
between updating repeated properties.

(Eg: A.a with 2 elements, B.b with 3 elements, A.c with 3 elements ->
A would end up with an element of B's kind)
parthea pushed a commit that referenced this pull request Nov 16, 2022
… ds (#824)

Legacy NDB had a bug where, with repeated Expando properties, it could
end up writing arrays of different length if some entities had missing
values for certain subproperties. When Cloud NDB read this out, it might
have only loaded entities corresponding to the shorter array length.
See issue #129 .

To fix this, with PR #176 , we made Cloud NDB check if there are length
differences and pad out the array as necessary.

However, depending on the order properties are returned from Datastore in,
we may have accidentally padded with subentities of the wrong kind,
because it was possible to skip over updating the kind if we alternated
between updating repeated properties.

(Eg: A.a with 2 elements, B.b with 3 elements, A.c with 3 elements ->
A would end up with an element of B's kind)
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.

older style structured properties issue
3 participants