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

bigquery: add Client.update_dataset #4003

Merged
merged 9 commits into from
Sep 20, 2017
Merged

Conversation

jba
Copy link
Contributor

@jba jba commented Sep 19, 2017

Also, remove Dataset.patch and Dataset.update.

@jba jba requested a review from lukesneeringer as a code owner September 19, 2017 20:23
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 19, 2017
@jba jba requested review from tseaver, tswast and alixhami September 19, 2017 20:24
Copy link
Contributor

@tswast tswast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM.

We need to be clearer in the docs for fields if they are for the Python way of describing the properties or the API way.

Feel free to ignore / wait for a subsequent PR on the additional thoughts on how we might support new fields that we don't have have implemented.

:param dataset: the dataset to update.

:type fields: sequence of string
:param fields: the fields of ``dataset`` to change.

This comment was marked as spam.

This comment was marked as spam.

dataset.dataset_id)
partial = {}
for f in fields:
if f not in Dataset._updateable_fields:

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

api_response = self._connection.api_request(
method='PATCH', path=path, data=partial, headers=headers)
ds = Dataset(dataset.dataset_id, project=dataset.project, client=self)
ds._set_properties(api_response)

This comment was marked as spam.

This comment was marked as spam.

self.assertEqual(ds2.friendly_name, 'Friendly')
self.assertEqual(ds2.description, 'Description')

# TODO(jba): test that read-modify-write with ETag works.

This comment was marked as spam.

@jba jba merged commit e8b0760 into googleapis:bigquery-b2 Sep 20, 2017
tswast pushed a commit that referenced this pull request Sep 25, 2017
* bigquery: add Client.update_dataset

Remove Dataset.patch and Dataset.update.

* improve cover

* more coverage

* update system tests

* more coverage

* add creds to client

* small changes

* .

* convert Python field name to API field name
tswast pushed a commit that referenced this pull request Oct 12, 2017
* bigquery: add Client.update_dataset

Remove Dataset.patch and Dataset.update.

* improve cover

* more coverage

* update system tests

* more coverage

* add creds to client

* small changes

* .

* convert Python field name to API field name
tswast pushed a commit that referenced this pull request Oct 16, 2017
* bigquery: add Client.update_dataset

Remove Dataset.patch and Dataset.update.

* improve cover

* more coverage

* update system tests

* more coverage

* add creds to client

* small changes

* .

* convert Python field name to API field name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants