Uh oh!
There was an error while loading. Please reload this page.
datastore: Support decoding empty arrays - #2755
Conversation
googlebot
commented
Nov 18, 2016
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
udoprog
commented
Nov 18, 2016
I signed it! |
googlebot
commented
Nov 18, 2016
CLAs look good, thanks! |
dhermes
commented
Nov 18, 2016
@udoprog Can you give an example that currently fails, but would work under the changes in this PR? |
The python client doesn't permit writing an empty array, so you'll have to do that using another client (we do it using Java). Or, go into the cloud console and add an entity After this, run the following code: fromgoogle.cloudimportdatastoreif__name__=="__main__":
client=datastore.Client('my-project-1')
k=client.key('test', 'test')
e=client.get(k)
print(e)Without this patch, you should see: |
dhermes
commented
Nov 18, 2016
Thanks @udoprog! In order to actually merge this in, we'll need some unit tests. You can write them yourself, or I am happy to write them, since you've allowed maintainers to push commits to your PR branch. |
daspecster
commented
Nov 29, 2016
@dhermes won't google CLA bot wig out if multiple people commit? |
dhermes
commented
Nov 29, 2016
@daspecster It may, but we the humans can ignore it. |
udoprog
commented
Nov 30, 2016
My apologies I can't take a more active part in this right now. Feel free to just see this as a bug report and fix things whatever way suits you best. |
| exclude_values = set(value_pb.exclude_from_indexes | ||
| for value_pb in value_pb.array_value.values) | ||
| if len(exclude_values) != 1: | ||
| if len(exclude_values) > 1: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
lukesneeringer
commented
Mar 16, 2017
See also #3152, where I attempted to fix this problem and hit another problem. We likely do not need two issues for it, though, so I am closing this one. |
…oudPlatform/python-docs-samples#2755) * Add auto-generated Logo Recognition Samples * Add tests Remove boilerplate Update copyright date Blacken Remove unused imports Shorten docstrings Remove CLI Set defaults in function definition * Edit test video to 3 seconds from 35 Reduce quota usage to allow for parallel tests Retain longer version only for tests that require it * Fix bug Co-authored-by: Noah Negrey <nnegrey@users.noreply.github.com> Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
When the
array_valueis empty, the set also becomes empty which triggers the existing conditionlen(exclude_values) != 0.This patch changes this condition to permit empty array values to pass through.