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 'Client.get_job' API wrapper. #3804

Merged
merged 6 commits into from
Sep 11, 2017
Merged

Add 'Client.get_job' API wrapper. #3804

merged 6 commits into from
Sep 11, 2017

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented Aug 13, 2017

Note that 177caa5 fixes a longstanding bug: Job configuration properties were not replaced when loading a job from the server. Unfortunately, I can't find the bug after the huge pile of issue closures this week.

The helper for constructing concrete query params added in cc4ba04 is a more general form of the one I did in-place in #3802, and should replace that version.

@tseaver tseaver added the api: bigquery Issues related to the BigQuery API. label Aug 13, 2017
@tseaver tseaver requested review from tswast and dhermes August 13, 2017 00:31
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 13, 2017
@tseaver tseaver mentioned this pull request Aug 13, 2017
18 tasks
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.

Woohoo! Just one small integer conversion request.


path = '/projects/{}/jobs/{}'.format(project, job_name)

resource = self._connection.api_request(

This comment was marked as spam.

self.priority = configuration.get('priority')
self.write_disposition = configuration.get('writeDisposition')
self.maximum_billing_tier = configuration.get('maximumBillingTier')
self.maximum_bytes_billed = configuration.get('maximumBytesBilled')

This comment was marked as spam.

@@ -187,6 +187,35 @@ def job_from_resource(self, resource):
return QueryJob.from_api_repr(resource, self)
raise ValueError('Cannot parse job resource')

def get_job(self, job_name, project=None):

This comment was marked as spam.

configuration.get('maxBadRecords'))
self.null_marker = configuration.get('nullMarker')
self.quote_character = configuration.get('quote')
self.skip_leading_rows = _int_or_none(

This comment was marked as spam.

This comment was marked as spam.

@@ -1481,6 +1528,81 @@ def test_to_api_repr_w_nested_struct(self):
self.assertEqual(param.to_api_repr(), EXPECTED)


class Test__query_param_from_api_repr(unittest.TestCase):

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.

tseaver and others added 6 commits September 8, 2017 09:44
    "maximumBytesBilled": {
     "type": "string",
     "description": "[Optional] Limits the bytes billed for this job. Queries that will have bytes billed beyond this limit will fail (without incurring a charge). If unspecified, this will be set to your project default.",
     "format": "int64"
    },

From https://www.googleapis.com/discovery/v1/apis/bigquery/v2/rest

Since it needs to represent a 64-bit integer the JSON number type is insufficient, so it must be sent as a string.
@tseaver
Copy link
Contributor Author

tseaver commented Sep 11, 2017

@tswast Any remaining issues? I'd like to get this one and #3803 merged to the bigquery-b2 branch today, so that I can rebase it against master for ongoing B2 work.

@@ -1481,6 +1528,81 @@ def test_to_api_repr_w_nested_struct(self):
self.assertEqual(param.to_api_repr(), EXPECTED)


class Test__query_param_from_api_repr(unittest.TestCase):

This comment was marked as spam.

@tseaver tseaver merged commit e57b152 into googleapis:bigquery-b2 Sep 11, 2017
@tseaver tseaver deleted the bigquery-b2-client-get_job branch September 11, 2017 16:32
tseaver added a commit that referenced this pull request Sep 11, 2017
* Allow assigning 'None' to '_TypedProperty' properties.

* Ensure that configuration properties are copied when (re)loading jobs.
tswast pushed a commit that referenced this pull request Sep 25, 2017
* Allow assigning 'None' to '_TypedProperty' properties.

* Ensure that configuration properties are copied when (re)loading jobs.
tswast pushed a commit that referenced this pull request Oct 12, 2017
* Allow assigning 'None' to '_TypedProperty' properties.

* Ensure that configuration properties are copied when (re)loading jobs.
tswast pushed a commit that referenced this pull request Oct 16, 2017
* Allow assigning 'None' to '_TypedProperty' properties.

* Ensure that configuration properties are copied when (re)loading jobs.
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.

3 participants