-
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
Add 'Client.get_job' API wrapper. #3804
Add 'Client.get_job' API wrapper. #3804
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.
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.
This comment was marked as spam.
Sorry, something went wrong.
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.
This comment was marked as spam.
Sorry, something went wrong.
@@ -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.
This comment was marked as spam.
Sorry, something went wrong.
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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -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.
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
"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.
@@ -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.
Sorry, something went wrong.
* Allow assigning 'None' to '_TypedProperty' properties. * Ensure that configuration properties are copied when (re)loading jobs.
* Allow assigning 'None' to '_TypedProperty' properties. * Ensure that configuration properties are copied when (re)loading jobs.
* Allow assigning 'None' to '_TypedProperty' properties. * Ensure that configuration properties are copied when (re)loading jobs.
* Allow assigning 'None' to '_TypedProperty' properties. * Ensure that configuration properties are copied when (re)loading jobs.
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.