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: replaces table.update() and table.patch() with client.update_table() #4076

Merged
merged 6 commits into from
Oct 9, 2017

Conversation

alixhami
Copy link
Contributor

No description provided.

@alixhami alixhami added the api: bigquery Issues related to the BigQuery API. label Sep 27, 2017
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 27, 2017
resource['description'] = self.description

if self.expires is not None:
if self.expires is not None and fields == [] or 'expires' in 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.

This comment was marked as spam.


if self._schema:
if (

This comment was marked as spam.

This comment was marked as spam.

@@ -830,7 +830,7 @@ def test_update_table_w_schema_None(self):
'projectId': project,
'datasetId': dataset_id,
'tableId': table_id},
'schema': {'fields': []}
'schema': []

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

resource['view']['query'] = self.view_query

def _populate_schema_resource(self, resource):
if len(self._schema) == 0:

This comment was marked as spam.

This comment was marked as spam.

client = self._make_one(project=project, credentials=creds)
conn = client._connection = _Connection(resource)
table_ref = client.dataset(dataset_id).table(table_id)
table = Table(table_ref, schema=schema, client=client)

This comment was marked as spam.

This comment was marked as spam.

@@ -616,41 +619,58 @@ def _set_properties(self, api_response):
cleaned['expirationTime'] = float(cleaned['expirationTime'])
self._properties.update(cleaned)

def _build_resource(self):
def _populate_expires_resource(self, resource):
value = _millis_from_datetime(self.expires)

This comment was marked as spam.

This comment was marked as spam.

'fields': _build_schema_resource(self._schema)
}

custom_resource_fields = {

This comment was marked as spam.

This comment was marked as spam.

'partitioning_type', 'view_use_legacy_sql', 'view_query', 'schema'
]
for f in all_fields:
if filter_fields and f not in filter_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.

This comment was marked as spam.

custom_resource_fields[f](resource)
else:
# snake case to camel case
words = f.split('_')

This comment was marked as spam.

This comment was marked as spam.

'view_use_legacy_sql': self._populate_view_use_legacy_sql_resource,
'schema': self._populate_schema_resource
}
all_fields = [

This comment was marked as spam.

This comment was marked as spam.

@alixhami alixhami merged commit ccf9c7a into googleapis:bigquery-b2 Oct 9, 2017
@alixhami alixhami deleted the bq-update-table branch October 9, 2017 17:36
tswast pushed a commit that referenced this pull request Oct 12, 2017
…e_table() (#4076)

* adds client.update_table()

* removes table.update() and table.patch()

* adds coverage for _verifyResourceProperties()

* adds test for deleting property and refactors table resource creation

* fixes update_table tests

* Fixes logic in _build_resource()
tswast pushed a commit that referenced this pull request Oct 16, 2017
…e_table() (#4076)

* adds client.update_table()

* removes table.update() and table.patch()

* adds coverage for _verifyResourceProperties()

* adds test for deleting property and refactors table resource creation

* fixes update_table tests

* Fixes logic in _build_resource()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the BigQuery API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants