Skip to content

Conversation

@dhermes
Copy link
Contributor

@dhermes dhermes commented Feb 10, 2015

Handles 3 previously supported cases in single method.

@tseaver I wanted to see what you think of this before

  1. Killing the 3-pronged approach download_(to_file|to_filename|as_string)
  2. Porting the unit tests over (currently Blob.download() is only indirectly covered)
  3. Doing the equivalent consolidation of upload_from_(file|filename|string)

I also only performed buffer_obj.close() in the filename case because buffers may need to perform more actions after the download and one of the tests assumed this behavior. (Could also close the BytesIO created.)

Handles 3 previously supported cases in single method.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 10, 2015
@dhermes dhermes added the api: storage Issues related to the Cloud Storage API. label Feb 10, 2015
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 0906d22 on dhermes:single-blob-download into b395360 on GoogleCloudPlatform:master.

@tseaver
Copy link
Contributor

tseaver commented Feb 10, 2015

I still think this simplification would be smoother if we required the caller to pass in a file-like object (readable for upload, writeable for download), removing the messiness about "when to close" from the library's scope.

@tseaver
Copy link
Contributor

tseaver commented Feb 11, 2015

This feels backwards: e.g., the update_mtime branching is a strong signal that download() is doing too much: that should only be relevant in a download_to_filename case. I can't see any win here to an AIO method, when what the caller wants can differ so much.

@dhermes
Copy link
Contributor Author

dhermes commented Feb 12, 2015

@tseaver OK We can close out for now.

I did (and still do somewhat) feel icky having 3 methods named download_. But you're right, they all have distinct reasons for being used.

@tseaver tseaver closed this Feb 12, 2015
@dhermes dhermes deleted the single-blob-download branch February 12, 2015 19:34
vchudnov-g pushed a commit that referenced this pull request Sep 20, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea added a commit that referenced this pull request Aug 21, 2025
* feat: add estimated physical file sizes to ReadAPI v1

PiperOrigin-RevId: 542350532

Source-Link: googleapis/googleapis@a4ff1c2

Source-Link: googleapis/googleapis-gen@b5b5fe5
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjViNWZlNWRjZDRiY2UxNWI3YjkwMzViOTI1NDUyZWU3Y2FmNDg5YiJ9

* 🦉 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 <[email protected]>
parthea added a commit that referenced this pull request Sep 16, 2025
* feat: add estimated physical file sizes to ReadAPI v1

PiperOrigin-RevId: 542350532

Source-Link: googleapis/googleapis@a4ff1c2

Source-Link: googleapis/googleapis-gen@b5b5fe5
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjViNWZlNWRjZDRiY2UxNWI3YjkwMzViOTI1NDUyZWU3Y2FmNDg5YiJ9

* 🦉 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 <[email protected]>
parthea pushed a commit that referenced this pull request Nov 24, 2025
Allow warehouse name (package name in `setup.py`) to be customized via a CLI option.

This is a pretty common reason for a `synth.py` regex replace:
- One repo has more than one API (e.g., Bigtable and Bigtable Admin) but the package name should always be `google-cloud-bigtable`
- We want an extra `-` in the repo name and package name to make it easier to read and type. (`google-cloud-binaryauthorization` -> `google-cloud-binary-authorization`)
- Package name constructed from the namespace doesn't match the `google-cloud-{API}` convention (`google-cloud-devtools-containeranalysis` -> `google-cloud-containeranalysis`)

Fixes #605
parthea pushed a commit that referenced this pull request Nov 24, 2025
🤖 I have created a release \*beep\* \*boop\* 
---
## [0.39.0](https://www.github.com/googleapis/gapic-generator-python/compare/v0.38.0...v0.39.0) (2020-12-22)


### Features

* allow warehouse name to be customized ([#717](https://www.github.com/googleapis/gapic-generator-python/issues/717)) ([7c185e8](https://www.github.com/googleapis/gapic-generator-python/commit/7c185e87cb4252b1f99ed121515814595f9492c4)), closes [#605](https://www.github.com/googleapis/gapic-generator-python/issues/605)


### Bug Fixes

* fix sphinx identifiers ([#714](https://www.github.com/googleapis/gapic-generator-python/issues/714)) ([39be474](https://www.github.com/googleapis/gapic-generator-python/commit/39be474b4419dfa521ef51927fd36dbf257d68e3)), closes [#625](https://www.github.com/googleapis/gapic-generator-python/issues/625) [#604](https://www.github.com/googleapis/gapic-generator-python/issues/604)
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please).
parthea added a commit that referenced this pull request Nov 24, 2025
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
parthea added a commit that referenced this pull request Nov 24, 2025
* chore(python): remove CONTRIBUTING.rst from templates

Source-Link: googleapis/synthtool@c96fb11
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:710b70faff81151657d89db6e028c23a1051787598c8276bdd8eef25c92da8ab

* 🦉 Updates from OwlBot post-processor

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

* 🦉 Updates from OwlBot post-processor

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

* 🦉 Updates from OwlBot post-processor

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

* Remove replacement in owlbot.py

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants