Title: Datastore query limits are silently truncated by the v1beta3 API · Issue #1763 · googleapis/google-cloud-python · GitHub
Open Graph Title: Datastore query limits are silently truncated by the v1beta3 API · Issue #1763 · googleapis/google-cloud-python
X Title: Datastore query limits are silently truncated by the v1beta3 API · Issue #1763 · googleapis/google-cloud-python
Description: This bug manifests itself in a couple of "fun" ways: len(list(client.query(kind="Foo").fetch(limit=300))) Will yield 300, assuming there are 300 or more entities of that kind. len(list(client.query(kind="Foo").fetch(limit=500))) Assuming...
Open Graph Description: This bug manifests itself in a couple of "fun" ways: len(list(client.query(kind="Foo").fetch(limit=300))) Will yield 300, assuming there are 300 or more entities of that kind. len(list(client.query...
X Description: This bug manifests itself in a couple of "fun" ways: len(list(client.query(kind="Foo").fetch(limit=300))) Will yield 300, assuming there are 300 or more entities of that kind. l...
Opengraph URL: https://github.com/googleapis/google-cloud-python/issues/1763
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Datastore query limits are silently truncated by the v1beta3 API","articleBody":"This bug manifests itself in a couple of \"fun\" ways:\n\n``` python\nlen(list(client.query(kind=\"Foo\").fetch(limit=300)))\n```\n\nWill yield `300`, assuming there are `300` or more entities of that kind.\n\n``` python\nlen(list(client.query(kind=\"Foo\").fetch(limit=500)))\n```\n\nAssuming there are `500` entities of that kind, will yield `500`. If there are `n` entities where `n \u003e 500`, it will yield `n`.\n\nThis all seems to be caused by the `v1beta3` api truncating the limits to `300`:\n\n``` python\nentities, more, cursor = client.query(kind=\"Foo\").fetch(limit=500).next_page()\n```\n\n`len(entities)` will be `300` and _not_ `500` even if there are `500` or more entities of that kind. \n\nWe're currently using the following snippet to work around this issue:\n\n``` python\n\ndef _all_entities(iterator):\n entities, cursor = [], None\n while iterator._limit \u003e 0:\n xs, more, cursor = iterator.next_page()\n iterator._limit -= len(xs)\n entities.extend(xs)\n if not more:\n break\n\n return entities, cursor\n```\n","author":{"url":"https://github.com/Bogdanp","@type":"Person","name":"Bogdanp"},"datePublished":"2016-04-28T12:48:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":19},"url":"https://github.com/1763/google-cloud-python/issues/1763"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0ce72b3c-2750-88a0-8249-30dcf1f25c79 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CF36:35723D:17E8FF:1FDA9F:6A4D8602 |
| html-safe-nonce | 38ae1d072c3d2978f6b93b521e8e746a305f0f879148ddddfc516a42ab06f5b0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjM2OjM1NzIzRDoxN0U4RkY6MUZEQTlGOjZBNEQ4NjAyIiwidmlzaXRvcl9pZCI6IjU1MDU1MDU3OTcyNTYwODcwNDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 81ecfb9f1e02ac59bc548c7d04f63a86cf762f62cdfde11a85de79d6084194e5 |
| hovercard-subject-tag | issue:151632936 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/google-cloud-python/1763/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e598456dc3f2cf13807553707dbf6d3d4d7304abf382a56740ee4b90dffa73ea/googleapis/google-cloud-python/issues/1763 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e598456dc3f2cf13807553707dbf6d3d4d7304abf382a56740ee4b90dffa73ea/googleapis/google-cloud-python/issues/1763 |
| og:image:alt | This bug manifests itself in a couple of "fun" ways: len(list(client.query(kind="Foo").fetch(limit=300))) Will yield 300, assuming there are 300 or more entities of that kind. len(list(client.query... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Bogdanp |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6bf61c909482ec3072ef5d7a5a28f2a9d214788c9a44793eca1960048cb05ae |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/google-cloud-python git https://github.com/googleapis/google-cloud-python.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 16316451 |
| octolytics-dimension-repository_nwo | googleapis/google-cloud-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 16316451 |
| octolytics-dimension-repository_network_root_nwo | googleapis/google-cloud-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6702a58b419a792226bd21ef0fb1bcb318bbcaa3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width