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 — #825: Allow passing explicit connection to dataset API methods. by tseaver · Pull Request #858 · googleapis/google-cloud-python

Conversation

@tseaver

@tseaver tseaver commented May 4, 2015

Copy link
Copy Markdown
Contributor

See #825.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tseaver
Allow passing explicit connection to dataset API methods.
9130c03
See #825.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 4, 2015
@tseaver tseaver added the api: datastore Issues related to the Datastore API. label May 4, 2015
@tseaver tseaver mentioned this pull request May 4, 2015
Add optional 'connection' parameter for any method that hits the wire #825
Closed
@coveralls

coveralls commented May 4, 2015

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 9130c03 on tseaver:825-datastore-dataset_explicit_connection into 8b5c5b9 on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dhermes
dhermes reviewed May 4, 2015
View reviewed changes
Comment thread gcloud/datastore/dataset.py Outdated

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented May 4, 2015

Copy link
Copy Markdown
Contributor

I agree with the spirit of #825 but I think the Dataset was already doing the right thing. Maybe we should just make the connection required in the constructor?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver

tseaver commented May 4, 2015

Copy link
Copy Markdown
Contributor Author

ISTM that it would be better to just delete the connection attribute altogether from Dataset, because the methods it proxies to already DTRT if pass connection=None.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented May 4, 2015

Copy link
Copy Markdown
Contributor

If we go the "clients everywhere" route, then Dataset needs to hold the same properties as _DefaultsContainer.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver

tseaver commented May 4, 2015

Copy link
Copy Markdown
Contributor Author

I'm actually opposed to the "client" notion at this point: I think the "use a connection as a context manager" bit would work better. We don't need to weld the project ID together with the connection, since it is only passed in a few cases.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver

tseaver commented May 4, 2015

Copy link
Copy Markdown
Contributor Author

I think @jgeewax was actually in agreement with that notion at the end of the last call, too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jgeewax

jgeewax commented May 6, 2015

Copy link
Copy Markdown
Contributor

I'm a fan of the Client pattern that Danny is tossing around -- take a look at #861? Maybe we can discuss it there?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented May 6, 2015

Copy link
Copy Markdown
Contributor

It would be nice to avoid churn if we could.

I think making connections constructable with one-liner factories that also pull in credentials will make things easier (in addition to making them have long-lived contexts). If we need clients, we can go that route, but if we don't we can move forward instead of chasing our tail.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver
Expunge 'Dataset.connection' attr.
a671672
@tseaver

tseaver commented May 6, 2015

Copy link
Copy Markdown
Contributor Author

@dhermes a671672 removes the Dataset.connection attribute altogether -- I think it makes for a better DX.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented May 6, 2015

Copy link
Copy Markdown
Contributor

@tseaver How does it help? What is better? It certainly doesn't capture the idea of a pre-loaded object. And after the change Dataset just becomes a string with a bunch of methods.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@coveralls

coveralls commented May 6, 2015

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling a671672 on tseaver:825-datastore-dataset_explicit_connection into 8b5c5b9 on GoogleCloudPlatform:master.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver

tseaver commented May 7, 2015

Copy link
Copy Markdown
Contributor Author

The goal of the Dataset class was to ease the process of constructing many-many objects which needed to be passed a dataset_id in their ctors. Bundling in yet-another-way-to-spell-a-non-default-connection adds neither clarity for the user, who is likely to be confused about how to signal it, nor in straightforwardness of implementation.

Except for Batch and Transaction objects, which necessarily wrap a connection object, I would say that any connection attribute in a user-visible object is a misfeature, across all the APIs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented May 7, 2015

Copy link
Copy Markdown
Contributor

This really just brings up the question: do all config defaults matter as a bundle or just the some of them.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver
Don't force connection before handing off to proxied code.
76e5c5d
Proxied functions/methods already handle that directly.
@tseaver tseaver mentioned this pull request May 14, 2015
Explore going the route of using Clients ? #861
Closed
@tseaver

tseaver commented May 14, 2015

Copy link
Copy Markdown
Contributor Author

ISTM we can't move on this until #861 settles out.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented May 14, 2015

Copy link
Copy Markdown
Contributor

Indeed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver tseaver added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jun 9, 2015
@dhermes

dhermes commented Jun 22, 2015

Copy link
Copy Markdown
Contributor

@tseaver this doesn't exactly fit the pattern of #910. I image you'll be binding clients to make Transaction work anyhow?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver tseaver closed this Jun 23, 2015
@tseaver
tseaver deleted the 825-datastore-dataset_explicit_connection branch June 23, 2015 20:36
parthea pushed a commit that referenced this pull request Aug 21, 2025
@renovate-bot @Linchin
chore(deps): update all dependencies (#858)
9c1d86d
* chore(deps): update all dependencies

* Update unittest.yml

---------

Co-authored-by: Lingqing Gan <[email protected]>
parthea pushed a commit that referenced this pull request Sep 16, 2025
@renovate-bot @Linchin @parthea
chore(deps): update all dependencies (#858)
129b161
* chore(deps): update all dependencies

* Update unittest.yml

---------

Co-authored-by: Lingqing Gan <[email protected]>
parthea pushed a commit that referenced this pull request Nov 24, 2025
@release-please
chore: release 0.45.0 (#858)
68c6d33
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
parthea pushed a commit that referenced this pull request Nov 24, 2025
@ReubenFrankel @chalmerlowe
fix: Log version check errors (#858)
02d26d8
* Use error log over `print` to avoid stdout write

* Move common return to end of function

* Update google/api_core/_python_version_support.py

Co-authored-by: Chalmer Lowe <[email protected]>

* Fix lint error

---------

Co-authored-by: Chalmer Lowe <[email protected]>
parthea pushed a commit that referenced this pull request Nov 24, 2025
@bw-yuhogg
chore: Add Python 3.11 to Trove classifiers (#858)
22c4340
parthea pushed a commit that referenced this pull request Nov 26, 2025
@eesheesh @gcf-owl-bot @arithmetic1728
feat: Improve handling of clock skew (#858)
449ca2d
* Allow up to 60 seconds of skew

* Add actionable/helpful error message text.

* 🦉 Updates from OwlBot

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: arithmetic1728 <[email protected]>
parthea pushed a commit that referenced this pull request Feb 13, 2026
@daniel-sanche
chore: librarian release pull request: 20260108T134327Z (#883)
b6f1ec6
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v1.0.1
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:c8612d3fffb3f6a32353b2d1abd16b61e87811866f7ec9d65b59b02eb452a620
<details><summary>google-api-core: 2.29.0</summary>

##
[2.29.0](googleapis/python-api-core@v2.28.1...v2.29.0)
(2026-01-08)

### Features

* make parse_version_to_tuple public (#864)
([c969186f](googleapis/python-api-core@c969186f))

* Auto enable mTLS when supported certificates are detected (#869)
([f8bf6f96](googleapis/python-api-core@f8bf6f96))

### Bug Fixes

* remove call to importlib.metadata.packages_distributions() for
py38/py39 (#859)
([628003e2](googleapis/python-api-core@628003e2))

* Log version check errors (#858)
([6493118c](googleapis/python-api-core@6493118c))

* flaky tests due to imprecision in floating point calculation and
performance test setup (#865)
([93404080](googleapis/python-api-core@93404080))

* closes tailing streams in bidi classes. (#851)
([c97b3a00](googleapis/python-api-core@c97b3a00))

</details>
parthea pushed a commit that referenced this pull request Mar 6, 2026
@plamut
process: add yoshi-python to samples CODEOWNERS (#858)
dbe8308
Closes #857.
parthea pushed a commit that referenced this pull request Mar 6, 2026
@ankiaga @gcf-owl-bot @olavloite
chore: Add support for named schema (#858)
22d8287
* chore: Add support for named schema

* Fix

* Comments addressed

* Comments addressed

* Comments addressed

* Comments addressed

* Removing quote method for table name

* Fix

* 🦉 Updates from OwlBot post-processor

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

* Update django_spanner/introspection.py

Co-authored-by: Knut Olav Løite <[email protected]>

---------

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

api: datastore Issues related to the Datastore API. cla: yes This human has signed the Contributor License Agreement. do not merge Indicates a pull request not ready for merge, due to either quality or timing.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@tseaver @coveralls @dhermes @jgeewax @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.