Skip to content

Commit 9bbacde

Browse files
committed
use jobReference.jobId instead, to not include the "project-id:" prefix for Job constructor
current code use the job.id from metadata in jobs.list api response to construct a Job; however it has the full format of "project-id:jobid-........." the constructed Job from this full id format can't be used for further acesss, like job.get job.getQueryResults server side will return an "Invalid job ID" error; see this fixes #2736 the metadata response has jobReference.jobId is exactly needed here; { kind: 'bigquery#job', etag: '"cX5UmbB_R-S07ii743IKGH9YCYM/4xT3EKx31LcQTmnaqUafpQ2RHqU"', id: 'project-id:job_D3tTAICe8jSlPuOw8CSvLEKs7-0C', selfLink: 'https://www.googleapis.com/bigquery/v2/projects/<project-id>/jobs/job_D3tTAICe8jSlPuOw8CSvLEKs7-0C', jobReference: { projectId: '<project-id>', jobId: 'job_D3tTAICe8jSlPuOw8CSvLEKs7-0C' },
1 parent eccb085 commit 9bbacde

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/bigquery/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ BigQuery.prototype.getJobs = function(options, callback) {
806806
}
807807

808808
var jobs = (resp.jobs || []).map(function(jobObject) {
809-
var job = that.job(jobObject.id);
809+
var job = that.job(jobObject.jobReference.jobId);
810810
job.metadata = jobObject;
811811
return job;
812812
});

0 commit comments

Comments
 (0)