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

Add properties for new job statistics #3721

Closed
wants to merge 15 commits into from
Closed

Add properties for new job statistics #3721

wants to merge 15 commits into from

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Aug 2, 2017

Closes #3706.

Note for reviewers: commit-by-commit might be an easier path.

@tseaver tseaver added api: bigquery Issues related to the BigQuery API. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Aug 2, 2017
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 2, 2017
@theacodes
Copy link
Contributor

I'm going to defer to @tswast for this.

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.

Thanks! A couple suggestions.

See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.queryPlan

:rtype: list of dict

This comment was marked as spam.

@@ -1277,6 +1297,170 @@ def from_api_repr(cls, resource, client):
job._set_properties(resource)
return job

@property
def query_plan(self):

This comment was marked as spam.

@@ -83,6 +83,17 @@ def __init__(self, project=None, credentials=None, _http=None):
project=project, credentials=credentials, _http=_http)
self._connection = Connection(self)

def _clone(self, project):

This comment was marked as spam.

t_project = table['projectId']
t_client = clients_by_project.get(t_project)
if t_client is None:
t_client = client._clone(t_project)

This comment was marked as spam.

This comment was marked as spam.

@@ -1390,6 +1390,20 @@ def referenced_tables(self):

return tables

@property
def num_dml_affected_rows(self):

This comment was marked as spam.

See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.schema

:rtype: list of :class:`~google.cloud.bigquery.schema.SchemaField

This comment was marked as spam.

See:
https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#statistics.query.undeclaredQueryParamters

:rtype: list of dict

This comment was marked as spam.

:returns: a new instance, bound to the supplied project, using
the same credentials / http object as this instance.
"""
return self.__class__(project, self._credentials, self._http)

This comment was marked as spam.

@tseaver tseaver mentioned this pull request Aug 12, 2017
18 tasks
@tseaver
Copy link
Contributor Author

tseaver commented Aug 12, 2017

@tswast I'm going to break this up into separate PRs, targeting the bigquery-b2 branch.

@tseaver tseaver deleted the 3706-bigquery-new-job-statistics branch September 8, 2017 12:56
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. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants