Skip to content
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

Restore 'Dataset' class. #660

Merged
merged 9 commits into from
Feb 18, 2015
Merged

Restore 'Dataset' class. #660

merged 9 commits into from
Feb 18, 2015

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Feb 17, 2015

Wrapper around 'datastore.api.{get,put,delete}', plus the 'Key',
'Batch', 'Transaction', and 'Query' factories.

Per @jgeewax in #659.

Wrapper around 'datastore.api.{get,put,delete}', plus the 'Key',
'Batch', 'Transaction', and 'Query' factories.

Per @jgeewax in #659.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 17, 2015


class Dataset(object):

This comment was marked as spam.

This comment was marked as spam.

@dhermes
Copy link
Contributor

dhermes commented Feb 17, 2015

LGTM pending Travis / comment

We should let @jgeewax sign off as well.

I don't like the factories but it makes sense in context and is certainly the lowest overhead answer

@dhermes
Copy link
Contributor

dhermes commented Feb 17, 2015

Slight retraction of LGTM: we should have an optional connection on the object

(Reviewing from phone)

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling c368db3 on tseaver:659-dataset-revenant into * on GoogleCloudPlatform:master*.

@tseaver
Copy link
Contributor Author

tseaver commented Feb 17, 2015

@dhermes if the user passes no connection to the ctor, would you see it looking one up from the implicit environ, or just passing None through to the wrapped APIs?

Pass it through to the API methods, rather than having the caller pass it.

Don't try to resolve it if None is passed (the API methods do that for us).
@tseaver
Copy link
Contributor Author

tseaver commented Feb 17, 2015

317ddfd assumes the second option I described.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 317ddfd on tseaver:659-dataset-revenant into * on GoogleCloudPlatform:master*.

@dhermes
Copy link
Contributor

dhermes commented Feb 17, 2015

@tseaver just wrapping up teaching for the day.

I did mean the option you chose but did not mean that connection should be removed from the signatures. However after thinking about it, ISTM that is the right choice. I.E. the dataset should not have a connection overridden as an option, so either pass to constructor or never use.

@dhermes
Copy link
Contributor

dhermes commented Feb 17, 2015

After this is in I'll try to put together my vision for lazy loaded defaults

@tseaver
Copy link
Contributor Author

tseaver commented Feb 18, 2015

@jgeewax PTAL

@dhermes dhermes added the api: datastore Issues related to the Datastore API. label Feb 18, 2015
Passes our ``dataset_id``.
"""
dataset_id = kwargs.pop('dataset_id', None)
if dataset_id not in (None, self.dataset_id):

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Passes our ``dataset_id``.
"""
if 'dataset_id' in kwargs:
raise TypeError('Cannot pass dataset_id')

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 3d2699e on tseaver:659-dataset-revenant into * on GoogleCloudPlatform:master*.

@dhermes
Copy link
Contributor

dhermes commented Feb 18, 2015

LGTM pending Sphinx links to the classes. We can merge after, yes?

@dhermes dhermes mentioned this pull request Feb 18, 2015
tseaver added a commit that referenced this pull request Feb 18, 2015
@tseaver tseaver merged commit 018b467 into googleapis:master Feb 18, 2015
@tseaver tseaver deleted the 659-dataset-revenant branch February 18, 2015 17:59
@dhermes
Copy link
Contributor

dhermes commented Feb 18, 2015

@tseaver Can you give an FYI / heads up when using [ci skip]?

@dhermes
Copy link
Contributor

dhermes commented Feb 18, 2015

@tseaver I'm gonna to submit a bunch of bite-sized PRs removing _implicit_environ and putting it all in dataset. SGTY?

@tseaver
Copy link
Contributor Author

tseaver commented Feb 18, 2015

Re: [ci skip]: the change was docstring-only, and I ran tox -e lint on it locally first. What kind of heads up did you want (you said, "LGTM pending Sphinx links to the classes. We can merge after, yes?").

@tseaver
Copy link
Contributor Author

tseaver commented Feb 18, 2015

Re: the PRs moving _implicit_environ to dataset: I guess I will have to see it -- I don't have the sense of it swapped in.

@dhermes
Copy link
Contributor

dhermes commented Feb 18, 2015

Just an "FYI: docstring only change, I used [ci skip]" (I agree it's totally valid)

@elibixby
Copy link

This looks great guys.

vchudnov-g pushed a commit that referenced this pull request Sep 20, 2023
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants