-
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
bigquery: add Client.update_dataset #4003
Conversation
There was a problem hiding this 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
This comment was marked as spam.
Sorry, something went wrong.
Remove Dataset.patch and Dataset.update.
* 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
* 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
* 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
Also, remove Dataset.patch and Dataset.update.