-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Datastore: Allow empty lists in protobuf array value #4778
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
Conversation
06c749e to
ba57396
Compare
ba57396 to
53c06dc
Compare
datastore/tests/unit/test_helpers.py
Outdated
| array_pb = array_val_pb.array_value.values | ||
| array_val_pb.array_value.CopyFrom(entity_pb2.ArrayValue(values=[])) | ||
|
|
||
| unindexed_value_pb1 = array_pb.add() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
This is what |
|
@lukesneeringer @tseaver Are we concerned about something else breaking if we merge this in? From what I understand of the code, the bug was only a problem if value has The other solution would be to check to see if It seems that the only case that the merged code would be different is that value has an Should we do a here or is there still too much risk concern? |
|
Or maybe Luke's version was better, since maybe the empty list may get excluded also? I originally thought we only needed to check the list, but on second thought, the |
2916603 to
a0fe60d
Compare
a0fe60d to
d6c6b9b
Compare
|
Changed to Luke's version |
|
I'll try again later. |
|
Superseded by #4915. |
Fixes #3152.
@lukesneeringer This was your fix, so I believe you should be able to get me an LGTM soon right? :)
@dhermes I would like to ask that you are ok with it since I mostly referred to your test_system code.
@tseaver Do you mind looking it over just so I didn't miss anything?
I consolidated all of our responses and comments and made this pull request.
I backed out the code change and the errors happen.
Separately, I have also investigated that
would
raise ValueErrorwhen put into an entity. It might be desired behavior, but we might need to deal with it at some point. The issue is thatlen(array_value.values)is 1 and the result for this was not[]as I had expected in the following code:Anyway, shall we get this merged soon please?