-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#825: Allow passing explicit connection to dataset API methods. #858
#825: Allow passing explicit connection to dataset API methods. #858
Conversation
"""Proxy to :func:`gcloud.datastore.api.get`. | ||
|
||
Passes our ``dataset_id``. | ||
""" | ||
if connection is None: | ||
connection = self.connection |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I agree with the spirit of #825 but I think the |
ISTM that it would be better to just delete the |
If we go the "clients everywhere" route, then |
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. |
I think @jgeewax was actually in agreement with that notion at the end of the last call, too. |
I'm a fan of the Client pattern that Danny is tossing around -- take a look at #861? Maybe we can discuss it there? |
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. |
@tseaver How does it help? What is better? It certainly doesn't capture the idea of a pre-loaded object. And after the change |
The goal of the Except for |
This really just brings up the question: do all config defaults matter as a bundle or just |
Proxied functions/methods already handle that directly.
ISTM we can't move on this until #861 settles out. |
Indeed |
See #825.