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 optional 'connection' parameter for any method that hits the wire · Issue #825 · googleapis/google-cloud-python

Add optional 'connection' parameter for any method that hits the wire #825

New issue
Copy link
New issue
Copy link
Closed
Closed
Add optional 'connection' parameter for any method that hits the wire#825
Copy link
Assignees
tseaver
Labels
api: core

Description

@jgeewax
jgeewax
opened on Apr 15, 2015
Issue body actions

From #796

@dhermes, @jgeewax could we make every API-triggering method take an optional connection argument, which would override the bound / default connection for only that call? Seems like that would be a useful pattern across all services; it would also help mark those methods as being API/latency relevant.

Activity

Next
  1. jgeewax
    added
    api: core
    on Apr 15, 2015
  2. jgeewax
    assigned
    tseaver
    on Apr 15, 2015
  3. jgeewax
    added this to the This milestone has been deleted milestone on Apr 15, 2015
  4. dhermes commented on Apr 15, 2015

    @dhermes
    dhermes
    on Apr 15, 2015
    Contributor
    More actions

    Thanks for filing. That's the goal. Mentioned this in #728 and #632 but it's not really spelled out.

  5. tseaver commented on Apr 16, 2015

    @tseaver
    tseaver
    on Apr 16, 2015
    Contributor
    More actions

    datastore

    Free API functions

    • api.get
    • api.put
    • api.delete
    • api.allocate_ids

    batch.Batch methods

    (note that Batch.__init__ takes a connection, handles fallback)

    • Batch.commit No real usecase for an explicit connection, given that Batch exists purely as a wrapper/proxy for an existing connection.

    dataset.Dataset methods

    (note that Dataset.__init__ takes a connection, defaulting to None).

    • Dataset.get (wraps api.get) (#825: Allow passing explicit connection to dataset API methods. #858)
    • Dataset.put (wraps api.put) (#825: Allow passing explicit connection to dataset API methods. #858)
    • Dataset.delete (wraps api.delete) (#825: Allow passing explicit connection to dataset API methods. #858)
    • Dataset.batch (Batch instance holds connection) (#825: Allow passing explicit connection to dataset API methods. #858)
    • Dataset.transaction (Transaction instance holds connection) (#825: Allow passing explicit connection to dataset API methods. #858)

    query.Query methods

    • Query.fetch (handles fallback, passes connection to Iterator)

    transaction.Transaction methods

    No real usecase for an explicit connection, given that Batch exists purely as a wrapper/proxy for an existing connection.

    (note that Transaction.__init__ takes a connection, handles fallback via Batch.__init__)

    • Transaction.begin
    • Transaction.rollback
    • Transaction.commit (delegates to Batch.commit)

    pubsub

    Free API functions

    • api.list_topics
    • api.list_subscriptions

    subscription.Subscription methods

    • Subscription.from_api_repr
    • Subscription.create (uses self.topic.connection) (#825: Allow passing explicit connection to pubsub API methods #859)
    • Subscription.exists (uses self.topic.connection) (#825: Allow passing explicit connection to pubsub API methods #859)
    • Subscription.reload (uses self.topic.connection) (#825: Allow passing explicit connection to pubsub API methods #859)
    • Subscription.modify_push_configuration (uses self.topic.connection) (#825: Allow passing explicit connection to pubsub API methods #859)
    • Subscription.pull (uses self.topic.connection) (#825: Allow passing explicit connection to pubsub API methods #859)
    • Subscription.acknowledge (uses self.topic.connection) (#825: Allow passing explicit connection to pubsub API methods #859)
    • Subscription.modify_ack_deadline (uses self.topic.connection) (#825: Allow passing explicit connection to pubsub API methods #859)
    • Subscription.delete (uses self.topic.connection) (#825: Allow passing explicit connection to pubsub API methods #859)

    topic.Topic methods:

    (note that Topic.__init__ takes a connection, handles fallback)

    • Topic.from_api_repr
    • Topic.create (uses self.connection) (#825: Allow passing explicit connection to pubsub API methods #859)
    • Topic.exists (uses self.connection) (#825: Allow passing explicit connection to pubsub API methods #859)
    • Topic.publish (uses self.connection) (#825: Allow passing explicit connection to pubsub API methods #859)
    • Topic.batch (delegates to _Batch instance) (#825: Allow passing explicit connection to pubsub API methods #859)
    • Topic.delete (uses self.connection) (#825: Allow passing explicit connection to pubsub API methods #859)

    topic._Batch methods:

    • _Batch.commit (uses self.topic.connection, called from __exit__ when batch used as a context manager) (#825: Allow passing explicit connection to pubsub API methods #859)

    storage

    _helpers._PropertyMixin methods (inherited by Blob / Bucket)

    • _PropertyMixin.reload (#825: Allow passing explicit connection to '_PropertyMixin.{reload,patch}'. #852)
    • _PropertyMixin.patch (#825: Allow passing explicit connection to '_PropertyMixin.{reload,patch}'. #852)

    acl.ACL methods

    • ACL.reload (#825: Allow passing explicit connection to ACL.{reload,save} #853)
    • ACL.save (#825: Allow passing explicit connection to ACL.{reload,save} #853)
    • ACL.clear (#825: Allow passing explicit connection to ACL.{reload,save} #853)

    acl.BucketACL methods

    • BucketACL.reload (#825: Allow passing explicit connection to ACL.{reload,save} #853)
    • BucketACL.save (#825: Allow passing explicit connection to ACL.{reload,save} #853)
    • BucketACL.clear (#825: Allow passing explicit connection to ACL.{reload,save} #853)

    acl.BlobACL methods

    • BlobACL.reload (#825: Allow passing explicit connection to ACL.{reload,save} #853)
    • BlobACL.save (#825: Allow passing explicit connection to ACL.{reload,save} #853)
    • BlobACL.clear (#825: Allow passing explicit connection to ACL.{reload,save} #853)

    Free API functions

    • api.lookup_bucket
    • api.list_buckets (handles fallback, passes connection to _BucketIterator)
    • api.get_bucket
    • api.create_bucket

    batch.Batch methods

    No real usecase for an explicit connection, given that Batch exists purely as a wrapper/proxy for an existing connection.
    (note that Batch.__init__ takes a connection, handles fallback)

    • Batch._do_request (uses self._connection)
    • Batch.finish (delegates to _do_request; called in __exit__ when batch used as a context manager).

    blob.Blob methods

    • Blob.connection property (delegates to self.bucket.connection) (Remove 'Blob.connection' property. #873)
    • Blob.generate_signed_url
    • Blob.exists
    • Blob.rename (delegates to self.bucket.copy_blob, #825: Allow passing explicit connection to 'Blob.{rename,delete}'. #854)
    • Blob.delete (delegates to self.bucket.delete_blob, #825: Allow passing explicit connection to 'Blob.{rename,delete}'. #854)
    • Blob.download_to_file
    • Blob.download_to_filename
    • Blob.download_as_string
    • Blob.upload_from_file
    • Blob.upload_from_filename
    • Blob.upload_from_string
    • Blob.make_public (#825: Allow passing explicit connection to 'Blob.make_public' #855)

    bucket.Bucket methods

    (note that Bucket.__init__ takes a connection, does not handle fallback)

    • Bucket.connection property (Remove 'Bucket.connection' property #876)
    • Bucket.exists (Removing most remaining uses of self.connection in Bucket #843)
    • Bucket.create (Removing most remaining uses of self.connection in Bucket #843)
    • Bucket.get_blob (Removing most remaining uses of self.connection in Bucket #843)
    • Bucket.delete (Removing most remaining uses of self.connection in Bucket #843)
    • Bucket.list_blobs (#825: Allow passing explicit connection to 'Bucket.{list_blobs,make public}' #856)
    • Bucket.delete_blob (Removing most remaining uses of self.connection in Bucket #843)
    • Bucket.delete_blobs (delegates to delete_blob) (Removing most remaining uses of self.connection in Bucket #843)
    • Bucket.copy_blob (Removing most remaining uses of self.connection in Bucket #843)
    • Bucket.upload_file (should die?) (Removing most remaining uses of self.connection in Bucket #843)
    • Bucket.upload_file_object (should die?) (Removing most remaining uses of self.connection in Bucket #843)
    • Bucket.make_public (#825: Allow passing explicit connection to 'Bucket.{list_blobs,make public}' #856)
  6. tseaver
    changed the title [-]Add connection as a parameter for any method that hits the wire?[/-] [+]Add optional 'connection' parameter for any method that hits the wire[/+] on May 1, 2015
  7. tseaver
    added 6 commits that reference this issue on May 4, 2015

    Merge pull request #854 from tseaver/825-storage_blob-explicit_connec…

    2e629e0

    Merge pull request #852 from tseaver/825-storage_property_mixin-allow…

    2cdaeb2

    Merge pull request #853 from tseaver/825-storage_acl-explicit_connection

    90b4f72

    Merge pull request #859 from tseaver/825-pubsub-explicit_connection

    aafcd2a

    Merge pull request #855 from tseaver/825-storage_blob_make_public-exp…

    d134452

    Merge pull request #856 from tseaver/825-storage_bucket_list_blobs_ma…

    290b09e
  8. dhermes commented on Aug 28, 2015

    @dhermes
    dhermes
    on Aug 28, 2015
    Contributor
    More actions

    @tseaver Please re-open if this isn't covered (by clients now instead of connections)

  9. dhermes
    closed this as completedon Aug 28, 2015
  10. parthea
    added a commit that references this issue on Jul 6, 2023

    Auto-update dependencies. [(#825)](GoogleCloudPlatform/python-docs-sa…

    dce055c
  11. 3 remaining items

  12. parthea
    added 2 commits that reference this issue on Sep 16, 2025

    chore(deps): update all dependencies (#825)

    ce79467

    chore(python): remove obsolete release scripts and config files (#825)

    49c0553
  13. parthea
    added 6 commits that reference this issue on Nov 22, 2025

    chore: add experimental async data client (#920)

    07c1344

    chore(main): release 2.25.1 (#825)

    e2c7c97

    build: update actions/upload-artifact and actions/download-artifact (#…

    c97be12

    chore(.github): Update python logging issues and prs assignee (#825)

    2f18394

    chore: Update release-please (#825)

    e59e950

    chore(.github): Update python logging issues and prs assignee (#825)

    c464a3a
  14. parthea
    added 7 commits that reference this issue on Mar 2, 2026

    chore: add experimental async data client (#920)

    5cd2349

    samples: add samples from pubsub/cloud-client (#134)

    8c90f22

    Auto-update dependencies. [(#825)](GoogleCloudPlatform/python-docs-sa…

    e6f8918

    chore: release 2.23.1 (#825)

    449d3a1

    build(deps): [autoapprove] bump cryptography from 41.0.0 to 41.0.2 (#825

    070db91

    chore(deps): update dependency cachetools to v6.2.6 (#825)

    1a33760

    chore(main): release 2.5.0 (#825)

    8a49d17
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: core

Type

No type

Projects

No projects

    Milestone

    No milestone

    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.