Title: `max_results` argument of `Client.list_blobs` does not behave correctly · Issue #425 · googleapis/python-storage · GitHub
Open Graph Title: `max_results` argument of `Client.list_blobs` does not behave correctly · Issue #425 · googleapis/python-storage
X Title: `max_results` argument of `Client.list_blobs` does not behave correctly · Issue #425 · googleapis/python-storage
Description: According to this maxResults should be: Maximum combined number of entries in items[] and prefixes[] to return in a single page of responses. Because duplicate entries in prefixes[] are omitted, fewer total results may be returned than r...
Open Graph Description: According to this maxResults should be: Maximum combined number of entries in items[] and prefixes[] to return in a single page of responses. Because duplicate entries in prefixes[] are omitted, fe...
X Description: According to this maxResults should be: Maximum combined number of entries in items[] and prefixes[] to return in a single page of responses. Because duplicate entries in prefixes[] are omitted, fe...
Opengraph URL: https://github.com/googleapis/python-storage/issues/425
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`max_results` argument of `Client.list_blobs` does not behave correctly","articleBody":"According to [this](https://cloud.google.com/storage/docs/json_api/v1/objects/list)\r\n\r\n`maxResults` should be:\r\n\u003e Maximum combined number of entries in items[] and prefixes[] to return in a **single page** of responses. Because duplicate entries in prefixes[] are omitted, fewer total results may be returned than requested. The service uses this parameter or 1,000 items, whichever is smaller. \r\n\r\nWhen I do this:\r\n```\r\nclient = storage.Client()\r\nbucket = storage.Bucket(client, \"\u003cbucket_name\u003e\")\r\nblobs_iterator = client.list_blobs(bucket, max_results=10)\r\nfor page in blobs_iterator.pages:\r\n print(page.num_items)\r\n```\r\nOutput:\r\n```\r\n10\r\n```\r\n\r\nOnly one iteration of the loop is completed even though there are 100 blobs in the bucket. It seems the `max_results` argument is limiting the **total** results rather than **per page** results.\r\n\r\nRelated to #19 ","author":{"url":"https://github.com/olfek","@type":"Person","name":"olfek"},"datePublished":"2021-04-29T12:01:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/425/python-storage/issues/425"}
| 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:b8c0534b-b81b-6601-d950-6effd46158d6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C446:3D7639:E61682:14D780B:6A4E5075 |
| html-safe-nonce | af801050521b0d34e8514ec0a4947e17bbed9d01f50a212fb2107eff682e0fba |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDQ2OjNENzYzOTpFNjE2ODI6MTRENzgwQjo2QTRFNTA3NSIsInZpc2l0b3JfaWQiOiI2ODE4ODE4NjQ1MzM1OTQyMjkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ae81d6af4ec19659e93a0c1528c308669077436c4995c87cbef7b7d7e559c4a6 |
| hovercard-subject-tag | issue:870939937 |
| 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/python-storage/425/issue_layout |
| twitter:image | https://opengraph.githubassets.com/46913917a625aa546f3d87d8b0663eefc8e653aa211f10251454d0dfe60070f3/googleapis/python-storage/issues/425 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/46913917a625aa546f3d87d8b0663eefc8e653aa211f10251454d0dfe60070f3/googleapis/python-storage/issues/425 |
| og:image:alt | According to this maxResults should be: Maximum combined number of entries in items[] and prefixes[] to return in a single page of responses. Because duplicate entries in prefixes[] are omitted, fe... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | olfek |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-storage git https://github.com/googleapis/python-storage.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 226992639 |
| octolytics-dimension-repository_nwo | googleapis/python-storage |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 226992639 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-storage |
| 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 | f344f1eab54fc7dfc02d0d018cda7e158c3db65c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width