Skip to content

Commit d9d5bd2

Browse files
committed
Remove spurious 'job_id' property.
The user-assigned 'name' is what is needed. Fixes googleapis#1399.
1 parent 881c96f commit d9d5bd2

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

docs/bigquery-usage.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ List jobs for a project:
279279
>>> from gcloud import bigquery
280280
>>> client = bigquery.Client()
281281
>>> jobs, token = client.list_jobs() # API request
282-
>>> [(job.job_id, job.type, job.created, job.state) for job in jobs]
283-
['e3344fba-09df-4ae0-8337-fddee34b3840', 'load', (datetime.datetime(2015, 7, 23, 9, 30, 20, 268260, tzinfo=<UTC>), 'done')]
282+
>>> [(job.nme, job.type, job.created, job.state) for job in jobs]
283+
['load-table-job', 'load', (datetime.datetime(2015, 7, 23, 9, 30, 20, 268260, tzinfo=<UTC>), 'done')]
284284

285285
Querying data (synchronous)
286286
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -331,8 +331,8 @@ Background a query, loading the results into a table:
331331
>>> job = client.run_async_query('fullname-age-query-job', query)
332332
>>> job.destination_table = table
333333
>>> job.write_disposition= 'truncate'
334-
>>> job.job_id
335-
'e3344fba-09df-4ae0-8337-fddee34b3840'
334+
>>> job.name
335+
'fullname-age-query-job'
336336
>>> job.type
337337
'query'
338338
>>> job.created
@@ -412,8 +412,8 @@ the job locally:
412412
>>> job.source_format = 'CSV'
413413
>>> job.skip_leading_rows = 1 # count of skipped header rows
414414
>>> job.write_disposition = 'truncate'
415-
>>> job.job_id
416-
'e3344fba-09df-4ae0-8337-fddee34b3840'
415+
>>> job.name
416+
'load-from-storage-job'
417417
>>> job.type
418418
'load'
419419
>>> job.created
@@ -469,8 +469,8 @@ located on Google Cloud Storage. First, create the job locally:
469469
... job.destination_format = 'CSV'
470470
... job.print_header = True
471471
... job.write_disposition = 'truncate'
472-
>>> job.job_id
473-
'e3344fba-09df-4ae0-8337-fddee34b3840'
472+
>>> job.name
473+
'extract-person-ages-job'
474474
>>> job.type
475475
'extract'
476476
>>> job.created
@@ -523,8 +523,8 @@ First, create the job locally:
523523
>>> destination_table = dataset.table(name='person_ages_copy')
524524
>>> job = client.copy_table(
525525
... 'copy-table-job', destination_table, source_table)
526-
>>> job.job_id
527-
'e3344fba-09df-4ae0-8337-fddee34b3840'
526+
>>> job.name
527+
'copy-table-job'
528528
>>> job.type
529529
'copy'
530530
>>> job.created

gcloud/bigquery/test_job.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def _makeResource(self, started=False, ended=False):
7171
def _verifyInitialReadonlyProperties(self, job):
7272
# root elements of resource
7373
self.assertEqual(job.etag, None)
74-
self.assertEqual(job.job_id, None)
7574
self.assertEqual(job.self_link, None)
7675
self.assertEqual(job.user_email, None)
7776

@@ -88,8 +87,6 @@ def _verifyInitialReadonlyProperties(self, job):
8887
def _verifyReadonlyResourceProperties(self, job, resource):
8988
from datetime import timedelta
9089

91-
self.assertEqual(job.job_id, self.JOB_ID)
92-
9390
statistics = resource.get('statistics', {})
9491

9592
if 'creationTime' in statistics:
@@ -337,7 +334,6 @@ def test_props_set_by_server(self):
337334
load_stats['outputRows'] = 345
338335

339336
self.assertEqual(job.etag, 'ETAG')
340-
self.assertEqual(job.job_id, JOB_ID)
341337
self.assertEqual(job.self_link, URL)
342338
self.assertEqual(job.user_email, EMAIL)
343339

0 commit comments

Comments
 (0)