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

'Connection.lookup' can return 'missing' and 'deferred' results #306

Closed
tseaver opened this issue Oct 28, 2014 · 12 comments · Fixed by #429
Closed

'Connection.lookup' can return 'missing' and 'deferred' results #306

tseaver opened this issue Oct 28, 2014 · 12 comments · Fixed by #429
Assignees
Labels
api: datastore Issues related to the Datastore API. 🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@tseaver
Copy link
Contributor

tseaver commented Oct 28, 2014

Do we need to support those fields?

@tseaver tseaver added type: question Request for information or clarification. Not an issue. api: datastore Issues related to the Datastore API. labels Oct 28, 2014
@tseaver
Copy link
Contributor Author

tseaver commented Oct 28, 2014

Options:

  • Have the user pass optional missing and / or deferred lists into lookup(), and populate them IFF they are not None.
  • Change lookup() to always return a three-tuple, (found, missing, deferred), where each item is a list (of entities, key-only entities, and keys, respectively).

@dhermes
Copy link
Contributor

dhermes commented Oct 28, 2014

I prefer the first option or just a different verb like fetch() versus fetch_page() with ndb.

@silvolu
Copy link
Contributor

silvolu commented Oct 28, 2014

IRT "do we need to support", they come quite cheap in the end, so it'd be good to have them.
@pcostell, out of curiosity, how likely is that deferred contains results?
I don't have any strong opinions about your proposals.

@pcostell
Copy link
Contributor

A small percentage of responses have deferred results. The field will only be populated if there were too many keys requested or the result size was too large. I would consider reissuing a lookup to get any deferred keys under the hood so that the user just gets all the results they requested.

@silvolu
Copy link
Contributor

silvolu commented Oct 28, 2014

I like @pcostell proposal.

@dhermes
Copy link
Contributor

dhermes commented Oct 28, 2014

I do too, with the caveat that we should let people pass in a boolean to disable the "more RPCs without telling the user" behavior and under that flag we could return the keys that were deferred?

@tseaver
Copy link
Contributor Author

tseaver commented Dec 17, 2014

Can we have the value passed in to disable extra under-the-covers RPCs be a list, into which the contents of the deferred field from the response would be copied? We could handle missing similarly. E.g.:

deferred = []
missing = []
entities = con.lookup(dataset_id, key_pbs, deferred=deferred, missing=missing)

If deferred isn't a list, then we do the "try again" dance as suggested by @pcostell. If missing isn't a list, then we just ignore it (the status quo).

@silvolu
Copy link
Contributor

silvolu commented Dec 17, 2014

SGTM. @dhermes ?

@dhermes
Copy link
Contributor

dhermes commented Dec 17, 2014

Yes I like this approach. Simple and convenient.

@tseaver tseaver self-assigned this Dec 17, 2014
@tseaver
Copy link
Contributor Author

tseaver commented Dec 17, 2014

@pcostell wrote:

I would consider reissuing a lookup to get any deferred keys under the hood so that the user
just gets all the results they requested.

Should the code sleep for some interval before retrying the deferred keys?

@pcostell
Copy link
Contributor

No need to sleep. There were just too many results in that request.

@dhermes
Copy link
Contributor

dhermes commented Dec 17, 2014

I feel like we should do something if a user requests 100,000 entities in a fetch other than just fetching until we have them all.

We already have reports of people trying to fetch large numbers of entities without proper understanding of what the implications are. We can provide guidance by throwing exceptions or printing error / warning messages. At the very least, people will wonder what is taking so long. (Even if it is PEBKAC)

@tseaver tseaver removed the type: question Request for information or clarification. Not an issue. label Dec 17, 2014
@jgeewax jgeewax modified the milestone: Datastore Stable Jan 30, 2015
urshala pushed a commit to urshala/google-cloud-python that referenced this issue Jan 17, 2020
Bug in share_type comparison on method 'share_with_invite'
@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 7, 2020
parthea pushed a commit that referenced this issue Jun 4, 2023
Source-Link: https://github.com/googleapis/synthtool/commit/d0f51a0c2a9a6bcca86911eabea9e484baadf64b
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:240b5bcc2bafd450912d2da2be15e62bc6de2cf839823ae4bf94d4f392b451dc
parthea pushed a commit that referenced this issue Jun 4, 2023
Source-Link: googleapis/synthtool@eb78c98
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163
parthea pushed a commit that referenced this issue Jun 4, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Jun 4, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Jun 4, 2023
* Removed snippets folder

* Add README.md
parthea pushed a commit that referenced this issue Jun 4, 2023
Source-Link: googleapis/synthtool@6ed3a83
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3abfa0f1886adaf0b83f07cb117b24a639ea1cb9cffe56d43280b977033563eb

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Jun 4, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
vchudnov-g pushed a commit that referenced this issue Sep 20, 2023
…led (#306)

* feat: added a field in the query result to indicate whether slot filling is cancelled.

PiperOrigin-RevId: 375741797

Source-Link: googleapis/googleapis@5e797ab

Source-Link: googleapis/googleapis-gen@45498d9

* 🦉 Updates from OwlBot

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Sep 22, 2023
* chore: Update gapic-generator-python to v1.9.0

PiperOrigin-RevId: 517425588

Source-Link: googleapis/googleapis@33c93eb

Source-Link: googleapis/googleapis-gen@d5f5978
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDVmNTk3ODlkMTlmYzQzMjcwZmYyMTI0OTY3ZDRlYzg5OTJiOGU4ZiJ9

* 🦉 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 pushed a commit that referenced this issue Sep 22, 2023
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 472772457

Source-Link: googleapis/googleapis@855b74d

Source-Link: googleapis/googleapis-gen@b64b1e7
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjY0YjFlN2RhM2UxMzhmMTVjYTM2MTU1MmVmMDU0NWU1NDg5MWI0ZiJ9
parthea pushed a commit that referenced this issue Sep 22, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Sep 22, 2023
Source-Link: googleapis/synthtool@7197a00
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:c43f1d918bcf817d337aa29ff833439494a158a0831508fda4ec75dc4c0d0320

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea added a commit that referenced this issue Sep 22, 2023
* chore: exclude requirements.txt file from renovate-bot

Source-Link: googleapis/synthtool@f58d313
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7a40313731a7cb1454eef6b33d3446ebb121836738dc3ab3d2d3ded5268c35b6

* update constraints files

* fix(deps): require protobuf 3.20.2

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea added a commit that referenced this issue Sep 22, 2023
* chore(python): drop python 3.6

Source-Link: googleapis/synthtool@4f89b13
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c

* add api_description to .repo-metadata.json

* require python 3.7+ in setup.py

* remove python 3.6 sample configs

* 🦉 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>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
…306)

Source-Link: googleapis/synthtool@95d9289
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:c8878270182edaab99f2927969d4f700c3af265accd472c3425deedff2b7fd93

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
Source-Link: googleapis/synthtool@eb78c98
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163
parthea pushed a commit that referenced this issue Oct 21, 2023
* chore: use gapic-generator-python 0.63.2
docs: add generated snippets

PiperOrigin-RevId: 427792504

Source-Link: googleapis/googleapis@55b9e1e

Source-Link: googleapis/googleapis-gen@bf4e86b
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9

* 🦉 Updates from OwlBot

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 pushed a commit that referenced this issue Oct 21, 2023
Source-Link: googleapis/synthtool@6ed3a83
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:3abfa0f1886adaf0b83f07cb117b24a639ea1cb9cffe56d43280b977033563eb

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this issue Oct 21, 2023
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 459095142

Source-Link: googleapis/googleapis@4f1be99

Source-Link: googleapis/googleapis-gen@ae686d9
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWU2ODZkOWNkZTRmYzNlMzZkMGFjMDJlZmI4NjQzYjE1ODkwYzFlZCJ9

feat: add audience parameter
PiperOrigin-RevId: 456827138

Source-Link: googleapis/googleapis@23f1a15

Source-Link: googleapis/googleapis-gen@4075a85
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDA3NWE4NTE0ZjY3NjY5MWVjMTU2Njg4YTViYmYxODNhYTk4OTNjZSJ9
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. 🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants