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

Expose 'missing'/'deferred' in 'Connection.lookup'/'Dataset.get_entities' #429

Merged
merged 7 commits into from
Dec 17, 2014
Merged

Expose 'missing'/'deferred' in 'Connection.lookup'/'Dataset.get_entities' #429

merged 7 commits into from
Dec 17, 2014

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Dec 17, 2014

If 'deferred' list is not passed, the connection retries any keys in
a deferred response.

Closes #306.

…ies'.

If 'deferred' list is not passed, the connection retries any keys in
a deferred response.

Closes #306.

results = [result.entity for result in lookup_response.found]
# Hmm, should we sleep here? Asked in:
# https://github.com/GoogleCloudPlatform/gcloud-python/issues/306#issuecomment-67377587

This comment was marked as spam.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 6b1b431 on tseaver:306-connection_lookup_missing_deferred into ac999e8 on GoogleCloudPlatform:master.

break

if lookup_response.deferred: # retry
for old_key in list(lookup_request.key):

This comment was marked as spam.

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Dec 17, 2014

Did a full review, everything looks good pending comments.

Also don't forget to remove the question in the comment about the sleep.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 2db4b5d on tseaver:306-connection_lookup_missing_deferred into ac999e8 on GoogleCloudPlatform:master.

@dhermes
Copy link
Contributor

dhermes commented Dec 17, 2014

So we still need to address [:] vs. .extend issue and the question of looping for a massive number of entities in a fetch.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 5ab96e8 on tseaver:306-connection_lookup_missing_deferred into ac999e8 on GoogleCloudPlatform:master.

@tseaver
Copy link
Contributor Author

tseaver commented Dec 17, 2014

@dhermes if the back-end imposed a limit on number of keys, we could just let that error propagate.

As it is, if the user straps a cannon to his shin and pulls the trigger, we can't do much to help. They may get a 503 (for DoSing the API) anyway, and if not, they eventually get their data (even if they rack up big charges for it).

@dhermes
Copy link
Contributor

dhermes commented Dec 17, 2014

We can make it harder to do pathological things, like putting the cannon in a locked cabinet in your analogy.

From previous discussions with @pcostell, the backend limits the number of keys and also the length of the request, but after that just dumps them in deferred. Now that you mention it though, 100,000 keys would probably exceed a maximum payload size of a request, which I'm sure exists.

@dhermes
Copy link
Contributor

dhermes commented Dec 17, 2014

Eek, lint failure.

@tseaver to make tox -e lint faster locally, I use

export GCLOUD_REMOTE_FOR_LINT="official"  # You use upstream I believe
export GCLOUD_BRANCH_FOR_LINT="master"

I wrote about it in the CONTRIBUTING.md file but I'm not sure anyone other than me uses it.

@tseaver
Copy link
Contributor Author

tseaver commented Dec 17, 2014

I normally run 'tox' (all environments). 9cd0f6a will clean it up.

@tseaver
Copy link
Contributor Author

tseaver commented Dec 17, 2014

Note also that running with those variables sometimes leads to false-positives (weird cases where the not-included files somehow help to satisfy a check).

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 9cd0f6a on tseaver:306-connection_lookup_missing_deferred into ac999e8 on GoogleCloudPlatform:master.

@tseaver
Copy link
Contributor Author

tseaver commented Dec 17, 2014

@dhermes anything left unaddressed?

Note that this kind of review is where the Github UI review breaks down: it is too hard for either the contributor or the reviewer to figure out what issues remain to be resolved.

@dhermes
Copy link
Contributor

dhermes commented Dec 17, 2014

The only remaining thing is the question about protecting novice users from themselves, which we can punt on in an issue.

Hopefully @pcostell or someone else can chime in on the discussion in #306.

LGTM

tseaver added a commit that referenced this pull request Dec 17, 2014
…ferred

Expose 'missing'/'deferred' in 'Connection.lookup'/'Dataset.get_entities'
@tseaver tseaver merged commit c2ba130 into googleapis:master Dec 17, 2014
@tseaver tseaver deleted the 306-connection_lookup_missing_deferred branch December 17, 2014 21:54
@dhermes dhermes added the api: datastore Issues related to the Datastore API. label Dec 31, 2015
parthea pushed a commit that referenced this pull request Jun 4, 2023
…429)

Source-Link: https://github.com/googleapis/synthtool/commit/b4fe62efb5114b6738ad4b13d6f654f2bf4b7cc0
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3bf87e47c2173d7eed42714589dc4da2c07c3268610f1e47f8e1a30decbfc7f1
parthea pushed a commit that referenced this pull request Jun 4, 2023
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 473833416

Source-Link: googleapis/googleapis@565a550

Source-Link: googleapis/googleapis-gen@1ee1a06
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWVlMWEwNmM2ZGUzY2E4Yjg0MzU3MmMxZmRlMDU0OGY4NDIzNjk4OSJ9
parthea pushed a commit that referenced this pull request Jul 6, 2023
* docs: Fix formatting of request arg in docstring

chore: Update gapic-generator-python to v1.9.1
PiperOrigin-RevId: 518604533

Source-Link: googleapis/googleapis@8a085ae

Source-Link: googleapis/googleapis-gen@b2ab4b0
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjJhYjRiMGEwYWUyOTA3ZTgxMmMyMDkxOThhNzRlMDg5OGFmY2IwNCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea added a commit that referenced this pull request Aug 15, 2023
* chore(deps): update all dependencies

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* revert

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this pull request Sep 20, 2023
…429)

Source-Link: https://github.com/googleapis/synthtool/commit/395d53adeeacfca00b73abf197f65f3c17c8f1e9
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:6c1cbc75c74b8bdd71dada2fa1677e9d6d78a889e9a70ee75b93d1d0543f96e1
vchudnov-g pushed a commit that referenced this pull request Sep 20, 2023
- [ ] Regenerate this pull request now.

docs: list oneofs in docstring
docs(v2beta1): clarified meaning of the legacy editions 
docs(v2beta1): clarified semantic of the streaming APIs 
fix(deps): require google-api-core >= 1.28.0
fix(deps): drop packaging dependency

committer: busunkim96@
PiperOrigin-RevId: 406468269

Source-Link: googleapis/googleapis@83d81b0

Source-Link: googleapis/googleapis-gen@2ff001f
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMmZmMDAxZmJhY2I5ZTc3ZTcxZDczNGRlNWY5NTVjMDVmZGFlODUyNiJ9
parthea pushed a commit that referenced this pull request Sep 22, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea added a commit that referenced this pull request Sep 22, 2023
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this pull request Oct 21, 2023
parthea pushed a commit that referenced this pull request Oct 21, 2023
Source-Link: https://github.com/googleapis/synthtool/commit/0ddbff8012e47cde4462fe3f9feab01fbc4cdfd6
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bced5ca77c4dda0fd2f5d845d4035fc3c5d3d6b81f245246a36aee114970082b
parthea pushed a commit that referenced this pull request Oct 21, 2023
…[autoapprove] (#429)

Source-Link: googleapis/synthtool@1f37ce7
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8e84e0e0d71a0d681668461bba02c9e1394c785f31a10ae3470660235b673086

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'Connection.lookup' can return 'missing' and 'deferred' results
3 participants