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

use jobReference.jobId instead, to not include the "project-id:" pref… #2737

Merged
merged 2 commits into from
Nov 9, 2017

Conversation

c0b
Copy link
Contributor

@c0b c0b commented Nov 9, 2017

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' },

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 9, 2017
…ix 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 googleapis#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' },
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling ef54121 on c0b:fix-issues/2736 into eccb085 on GoogleCloudPlatform:master.

@googlebot googlebot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Nov 9, 2017
@googleapis googleapis deleted a comment from coveralls Nov 9, 2017
@googleapis googleapis deleted a comment from googlebot Nov 9, 2017
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling f60bd12 on c0b:fix-issues/2736 into eccb085 on GoogleCloudPlatform:master.

@stephenplusplus stephenplusplus merged commit f10f61f into googleapis:master Nov 9, 2017
@stephenplusplus stephenplusplus added the api: bigquery Issues related to the BigQuery API. label Nov 9, 2017
@stephenplusplus
Copy link
Contributor

Thanks!

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: no This human has *not* signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bigquery: the Job got from getJobs does not work
4 participants