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 — STORAGE: Does a connection need to be bound to anything other than a Batch or Iterator? · Issue #728 · googleapis/google-cloud-python

STORAGE: Does a connection need to be bound to anything other than a Batch or Iterator? #728

New issue
Copy link
New issue
Copy link
Closed
Closed
STORAGE: Does a connection need to be bound to anything other than a Batch or Iterator?#728
Copy link
Assignees
dhermes
Labels
api: storageIssues related to the Cloud Storage API.
Milestone
Storage Stable

Description

@dhermes
dhermes
opened on Mar 13, 2015
Issue body actions

Run

$ git grep -n '\.connection' -- gcloud/datastore/ | egrep -v test | egrep -v 'datastore\.connection'
$ git grep -n '\.connection' -- gcloud/storage/ | egrep -v test | egrep -v 'storage\.connection'

to compare uses.

Activity

  1. dhermes
    added
    api: storageIssues related to the Cloud Storage API.
    on Mar 13, 2015
  2. dhermes
    added this to the Storage Stable milestone on Mar 13, 2015
  3. dhermes
    self-assigned this
    on Mar 14, 2015
  4. dhermes commented on Mar 14, 2015

    @dhermes
    dhermes
    on Mar 14, 2015
    ContributorAuthor
    More actions

    I'm going to start this work in a series of small changes (I'm guessing there will be a lot of test re-factoring).

    Please protest if there are any issues.

    UPDATE: After starting this, it seems quite daunting.

    After checking blob.py and bucket.py it seems the following methods all use a connection.

    From git grep -e '^ def' -- gcloud/storage/blob.py (edited by me):

    def generate_signed_url(self, expiration, method='GET'):
    def exists(self):
    def rename(self, new_name):
    def delete(self):
    def download_to_file(self, file_obj):
    def download_to_filename(self, filename):
    def download_as_string(self):
    def upload_from_file(self, file_obj, rewind=False, ...
    def upload_from_filename(self, filename, ...
    def upload_from_string(self, data, ...
    def make_public(self):  # Maybe not?
    

    From git grep -e '^ def' -- gcloud/storage/bucket.py (edited by me):

    def __iter__(self):
    def __contains__(self, blob_name):
    def exists(self):
    def create(self, project=None):
    def get_blob(self, blob_name):
    def get_all_blobs(self):
    def iterator(self, prefix=None, delimiter=None, max_results=None,
    def delete(self, force=False):
    def delete_blob(self, blob_name):
    def delete_blobs(self, blobs, on_error=None):
    def copy_blob(self, blob, destination_bucket, new_name=None):
    def upload_file(self, filename, blob_name=None):
    def upload_file_object(self, file_obj, blob_name=None):
    def make_public(self, recursive=False, future=False):
    

    (Updated March 31, 2015)

  5. dhermes commented on Mar 23, 2015

    @dhermes
    dhermes
    on Mar 23, 2015
    ContributorAuthor
    More actions

    @tseaver We have some methods which make HTTP requests for historical reasons only:

    • Bucket.update_cors (Making cors a property instead of having two separate methods. #768)
    • Bucket.get_default_object_acl (Removing Bucket.get_default_object_acl. #772)
    • Bucket.update_lifecycle (Adding Bucket.lifecycle_rules property to replace methods. #774)
    • Bucket.get_logging (Removing HTTP requests from Bucket logging methods. #769)
    • Bucket.enable_logging (Removing HTTP requests from Bucket logging methods. #769)
    • Bucket.disable_logging (Removing HTTP requests from Bucket logging methods. #769)
    • Bucket.configure_website (Removing patch() from Bucket.configure_website. #773)
    • Bucket.disable_website (Removing patch() from Bucket.configure_website. #773)
    • Bucket.make_public

    Also Blob.make_public doesn't really fit the rest of methods, but that makes an HTTP request via the ObjectACL. It seems hairier to unwind this.

  6. tseaver commented on Mar 26, 2015

    @tseaver
    tseaver
    on Mar 26, 2015
    Contributor
    More actions

    I think we could easily change the metadata-updating methods to drop the call (and require calling patch()). Maybe ACL updates should also require an explict patch or save call?

  7. dhermes commented on Mar 27, 2015

    @dhermes
    dhermes
    on Mar 27, 2015
    ContributorAuthor
    More actions

    @tseaver I agree. Being more declarative was the original goal of #545. I tried to sketch a way (in #761) to make these properties, but some of them are a bit involved (i.e. have multiple values associated).

    We could look into using apitools generated clients at some point?

  8. dhermes
    added a commit that references this issue on Mar 28, 2015

    Removing patch() from Bucket.configure_website.

    7cf10dd
  9. dhermes commented on Mar 31, 2015

    @dhermes
    dhermes
    on Mar 31, 2015
    ContributorAuthor
    More actions

    @tseaver Removing __iter__ and __contains__ is impossible if no Connection is bound to a Bucket. As I mention in #761, using __iter__ is pretty scary for large applications / buckets.

  10. dhermes
    added a commit that references this issue on Apr 28, 2015

    Making Bucket.(exists|create) have an optional connection.

    a14f18a
  11. dhermes
    closed this as completedon May 26, 2015
  12. parthea
    added a commit that references this issue on Aug 21, 2025

    feat: add ability to request compressed ReadRowsResponse rows (#728)

    3af9d0d
  13. parthea
    added a commit that references this issue on Sep 16, 2025

    feat: add ability to request compressed ReadRowsResponse rows (#728)

    b273890
  14. parthea
    added 5 commits that reference this issue on Nov 22, 2025

    chore: Update gapic-generator-python to v1.8.2 (#728)

    2b2caf6

    chore: add template README and tweak setup.py (#728)

    a3ddb98

    chore(python): upgrade gcp-releasetool in .kokoro [autoapprove] (#728)

    1738401

    fix: increase cache lock expiration time (#740)

    fe61584

    chore(python): upgrade gcp-releasetool in .kokoro [autoapprove] (#728)

    433e924
  15. parthea
    added 4 commits that reference this issue on Mar 6, 2026

    fix: inserting non-finite floats with insert_rows() (#728)

    0247954

    chore: release 2.21.0 (#753)

    020c5ee

    chore: release 2.21.0 (#760)

    4919152

    tests: cleanup and remove duplicate tests (#728)

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

Metadata

Metadata

Assignees

  • @dhermes
    dhermes

Labels

api: storageIssues related to the Cloud Storage API.

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.