Skip to content

Commit

Permalink
Rename job 'type' property -> 'job_type'.
Browse files Browse the repository at this point in the history
Addresses:
#1469 (comment)
  • Loading branch information
tseaver committed Feb 15, 2016
1 parent cf05309 commit 7b085f4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions docs/bigquery-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ List jobs for a project:
>>> from gcloud import bigquery
>>> client = bigquery.Client()
>>> jobs, token = client.list_jobs() # API request
>>> [(job.name, job.type, job.created, job.state) for job in jobs]
>>> [(job.name, job.job_type, job.created, job.state) for job in jobs]
['load-table-job', 'load', (datetime.datetime(2015, 7, 23, 9, 30, 20, 268260, tzinfo=<UTC>), 'done')]

Querying data (synchronous)
Expand Down Expand Up @@ -333,7 +333,7 @@ Background a query, loading the results into a table:
>>> job.write_disposition= 'truncate'
>>> job.name
'fullname-age-query-job'
>>> job.type
>>> job.job_type
'query'
>>> job.created
None
Expand Down Expand Up @@ -414,7 +414,7 @@ the job locally:
>>> job.write_disposition = 'truncate'
>>> job.name
'load-from-storage-job'
>>> job.type
>>> job.job_type
'load'
>>> job.created
None
Expand Down Expand Up @@ -471,7 +471,7 @@ located on Google Cloud Storage. First, create the job locally:
... job.write_disposition = 'truncate'
>>> job.name
'extract-person-ages-job'
>>> job.type
>>> job.job_type
'extract'
>>> job.created
None
Expand Down Expand Up @@ -525,7 +525,7 @@ First, create the job locally:
... 'copy-table-job', destination_table, source_table)
>>> job.name
'copy-table-job'
>>> job.type
>>> job.job_type
'copy'
>>> job.created
None
Expand Down
2 changes: 1 addition & 1 deletion gcloud/bigquery/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def __init__(self, name, client):
self.name = name

@property
def type(self):
def job_type(self):
"""Type of job
:rtype: string
Expand Down
8 changes: 4 additions & 4 deletions gcloud/bigquery/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def test_ctor(self):
self.assertTrue(job.destination is table)
self.assertEqual(list(job.source_uris), [self.SOURCE1])
self.assertTrue(job._client is client)
self.assertEqual(job.type, self.JOB_TYPE)
self.assertEqual(job.job_type, self.JOB_TYPE)
self.assertEqual(
job.path,
'/projects/%s/jobs/%s' % (self.PROJECT, self.JOB_NAME))
Expand Down Expand Up @@ -689,7 +689,7 @@ def test_ctor(self):
self.assertTrue(job.destination is destination)
self.assertEqual(job.sources, [source])
self.assertTrue(job._client is client)
self.assertEqual(job.type, self.JOB_TYPE)
self.assertEqual(job.job_type, self.JOB_TYPE)
self.assertEqual(
job.path,
'/projects/%s/jobs/%s' % (self.PROJECT, self.JOB_NAME))
Expand Down Expand Up @@ -988,7 +988,7 @@ def test_ctor(self):
self.assertEqual(job.source, source)
self.assertEqual(job.destination_uris, [self.DESTINATION_URI])
self.assertTrue(job._client is client)
self.assertEqual(job.type, self.JOB_TYPE)
self.assertEqual(job.job_type, self.JOB_TYPE)
self.assertEqual(
job.path,
'/projects/%s/jobs/%s' % (self.PROJECT, self.JOB_NAME))
Expand Down Expand Up @@ -1296,7 +1296,7 @@ def test_ctor(self):
job = self._makeOne(self.JOB_NAME, self.QUERY, client)
self.assertEqual(job.query, self.QUERY)
self.assertTrue(job._client is client)
self.assertEqual(job.type, self.JOB_TYPE)
self.assertEqual(job.job_type, self.JOB_TYPE)
self.assertEqual(
job.path,
'/projects/%s/jobs/%s' % (self.PROJECT, self.JOB_NAME))
Expand Down

0 comments on commit 7b085f4

Please sign in to comment.