Title: Storage: Bucket.list_blobs(max_results=n) does not behave as documented · Issue #19 · googleapis/python-storage · GitHub
Open Graph Title: Storage: Bucket.list_blobs(max_results=n) does not behave as documented · Issue #19 · googleapis/python-storage
X Title: Storage: Bucket.list_blobs(max_results=n) does not behave as documented · Issue #19 · googleapis/python-storage
Description: The max_results parameter of list_blobs() is documented as controlling the maximum number of blobs returned in each page of results, but actually limits the total number of results as the name implies. Compare the Bucket.list_blobs() doc...
Open Graph Description: The max_results parameter of list_blobs() is documented as controlling the maximum number of blobs returned in each page of results, but actually limits the total number of results as the name impl...
X Description: The max_results parameter of list_blobs() is documented as controlling the maximum number of blobs returned in each page of results, but actually limits the total number of results as the name impl...
Opengraph URL: https://github.com/googleapis/python-storage/issues/19
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Storage: Bucket.list_blobs(max_results=n) does not behave as documented","articleBody":"The `max_results` parameter of `list_blobs()` is documented as controlling the maximum number of blobs returned in each page of results, but actually limits the total number of results as the name implies.\r\n\r\nCompare the `Bucket.list_blobs()` documentation:\r\nhttps://googleapis.dev/python/storage/latest/buckets.html#google.cloud.storage.bucket.Bucket.list_blobs\r\n\u003e max_results (int) – The maximum number of blobs in each page of results from this request. Non-positive values are ignored. Defaults to a sensible value set by the API.\r\n\r\nWith the `Iterator` documentation:\r\nhttps://googleapis.dev/python/google-api-core/latest/page_iterator.html#google.api_core.page_iterator.Iterator\r\n\u003e max_results (int) – The maximum number of results to fetch.\r\n\r\nAlso the implementation of `HTTPIterator` which is used by `list_blobs()` internally does treat `max_results` as a hard limit for total `num_results`:\r\nhttps://github.com/googleapis/google-cloud-python/blob/master/api_core/google/api_core/page_iterator.py#L378\r\n\r\n#### Code example\r\n\r\n```python\r\niterator = some_big_bucket.list_blobs(max_results=100)\r\nassert len(list(iterator)) \u003e 100 # throws\r\nassert sum(len(list(page)) for page in iterator.pages) \u003e 100 # throws\r\n```\r\n\r\n#### Suggested resolution\r\n\r\nChange the documentation to match what the parameter actually does. If supplying a paging size is required, a new argument to `HTTPIterator` could be added and exposed up through the `list_blobs()` interface.","author":{"url":"https://github.com/bz2","@type":"Person","name":"bz2"},"datePublished":"2020-01-02T16:34:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/19/python-storage/issues/19"}
| 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:bb72ee91-2966-4bd5-8564-46ecbcd99d97 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E5FC:CD884:1733BF1:2012286:6A4EA3E8 |
| html-safe-nonce | 097a5528c62a82099b72990d383ebe4ebb45d10605991c749636ebd24a0a656d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUZDOkNEODg0OjE3MzNCRjE6MjAxMjI4Njo2QTRFQTNFOCIsInZpc2l0b3JfaWQiOiIyOTc3NDgwOTIxNDc5ODE2MTY4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e66697dbb069e90a13b5f222f12157ced3e2485bb30df465fc037a1cdfea60de |
| hovercard-subject-tag | issue:558429795 |
| 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/19/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7470273e0ac73b59845f07903e6cde8be74e90e461d2e1d15273288d7c235500/googleapis/python-storage/issues/19 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7470273e0ac73b59845f07903e6cde8be74e90e461d2e1d15273288d7c235500/googleapis/python-storage/issues/19 |
| og:image:alt | The max_results parameter of list_blobs() is documented as controlling the maximum number of blobs returned in each page of results, but actually limits the total number of results as the name impl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bz2 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c |
| 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 | e6a744804e8e70f97b4d5a18a94dcc63db22f97a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width