GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add support for batch requests in gcloud.storage · Issue #15 · googleapis/google-cloud-python

Add support for batch requests in gcloud.storage #15

New issue
Copy link
New issue
Copy link
Closed
Closed
Add support for batch requests in gcloud.storage#15
Copy link
Assignees
tseaver
Labels
api: storageIssues related to the Cloud Storage API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
Milestone
Storage Stable

Description

@jgeewax
jgeewax
opened on Feb 6, 2014
Issue body actions

Or wait for the new primitive client that simplifies this.

Activity

Next
  1. tseaver commented on Nov 7, 2014

    @tseaver
    tseaver
    on Nov 7, 2014
    Contributor
    More actions

    Is there a server-side API feature that this issue refers to?

  2. silvolu commented on Nov 7, 2014

    @silvolu
    silvolu
    on Nov 7, 2014
    Contributor
    More actions

    https://cloud.google.com/storage/docs/json_api/v1/how-tos/batch

    Not sure if apitools helps with this.

  3. tseaver commented on Nov 7, 2014

    @tseaver
    tseaver
    on Nov 7, 2014
    Contributor
    More actions

    Cool, I had missed that doc.

  4. silvolu commented on Nov 7, 2014

    @silvolu
    silvolu
    on Nov 7, 2014
    Contributor
    More actions

    It's kinda easy to get lost in the Cloud Encyclopedia :D

  5. tseaver commented on Nov 8, 2014

    @tseaver
    tseaver
    on Nov 8, 2014
    Contributor
    More actions

    I think we would end up implementing this by subclassing Connection, overriding api_request such that it stored params for non-idempotent HTTP requests (anything other than GET) (similar to the Transaction's mutation in datastore).

    I don't know how it should handle interleaving reads: write-after-read can lead to inconsistent state without some help from the server to isolate other changes.

    Another approach would be to use a pattern like #352, where the context manager hooks api_request to defer the writes.

  6. jgeewax
    modified the milestone: Storage Stable on Jan 30, 2015
  7. tseaver
    self-assigned this
    on Feb 12, 2015
  8. tseaver commented on Feb 12, 2015

    @tseaver
    tseaver
    on Feb 12, 2015
    Contributor
    More actions

    OK, here's a plan:

    • Move datastore.batch._Batches (which is just a thread-local stack) up to gcloud._localstack. Move the 'thread-local stack' implementation up from datastore. #622
    • Add storage.batch.Batch, paralleling datastore.batch.Batch, and exposing the same methods as storage.connection.Connection. This class will "store up" the mutations and generate the multipart/mixed payload defined in Sending Batch Requests. As with the datastore variant, this Batch should be usable as a context manager, as well as in "imperative" mode (where it will need to be passed into the buckets as their connection?). #15: Add storage.batch.Batch #654
    • Update storage.api to look first for the active batch, falling back to the implied default connection.
    • Update Bucket.__init__() to look first for the active batch, but fall back (per Should Blob and Bucket constructors fall back to _implicit_environ defaults? #621).
  9. dhermes commented on Feb 12, 2015

    @dhermes
    dhermes
    on Feb 12, 2015
    Contributor
    More actions

    SGTM.

  10. tseaver
    added a commit that references this issue on Feb 26, 2015

    Merge pull request #654 from tseaver/15-add_storage_batch

    f0a1157
  11. tseaver commented on Feb 26, 2015

    @tseaver
    tseaver
    on Feb 26, 2015
    Contributor
    More actions

    @dhermes, I'll hold off on the third point until your work on #632 clarifies (I think we would be stepping all over each other there).

  12. dhermes commented on Feb 26, 2015

    @dhermes
    dhermes
    on Feb 26, 2015
    Contributor
    More actions

    OK cool. I sent the first PR of the oncoming flood (I haven't written the flood yet, I just know it's coming).

  13. dhermes commented on Mar 9, 2015

    @dhermes
    dhermes
    on Mar 9, 2015
    Contributor
    More actions

    @tseaver I checked and verified that GET requests can be sent as part of batch requests.

    In order to accommodate this, we'd need to create a container object (maybe called Future, as in ndb) that we could hold onto and then populate when the batch returns.

    For example:

    >>> future_bucket = batch.get_bucket('BOGUS.NAME')
    >>> future_bucket
    <FutureBucket>
    >>> future_bucket.get()
    Traceback (most recent call last):
    ...
    ValueError: Batch not finished yet.
    >>>
    >>> batch.finish()
    >>> bucket = future_bucket.get()
    >>> bucket
    <Bucket: BOGUS.NAME>
  14. dhermes
    closed this as completedon Aug 28, 2015
  15. 103 remaining items

  16. parthea
    added 3 commits that reference this issue on Jan 10, 2025

    chore: start tracking obsolete files (#15)

    8c479cf

    chore: detect samples tests in nested directories (#15)

    c1fd013

    chore: add default CODEOWNERS (#15)

    7317728
  17. parthea
    added 8 commits that reference this issue on Nov 24, 2025

    Refactor the wrap filter. (#15)

    dcba21f

    Add renovate.json (#15)

    970ba39

    [chore] Version bump to 0.3.0. (#15)

    ba40b1c

    fix: map LRO errors to library exception types (#86)

    4be8ef1

    Merge pull request #15 from shopkick/fix_autogenerated_metrics

    803bc67

    feat: add quota_project, credentials file, and scopes options (#15)

    344aa4c

    Chore: fix missing changes (#15)

    992672c

    chore: update noxfile (#15)

    96aa7b8
  18. parthea
    added a commit that references this issue on Mar 2, 2026

    docs: README.md improvements (#15)

    d7b60eb
  19. parthea
    added 2 commits that reference this issue on Mar 9, 2026

    feat: add default schema name (#15)

    c0c9800

    refactor: remove unnecessary import (#15)

    5a4758a
  20. ohmayr
    added a commit that references this issue on Mar 31, 2026

    docs: README.md improvements (#15)

    4e25104
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @tseaver
    tseaver

Labels

api: storageIssues related to the Cloud Storage API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    • Storage Stable

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.