feat(bigquery): add support for listing jobs by parent job #9225
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #9190.
This PR adds the parent job filter to
client.list_jobs()
.How to test
Prerequisite: The (alpha) scripting feature must be enabled for your BigQuery project.
Create and run an SQL script on your project, then list jobs for that project. Find the parent job, i.e. the one whose
num_child_jobs
property is greater than zero, and use its ID to list the jobs again using theparent_job
filter. That call should correctly return only the parent job's child jobs.See the new system test in this PR for an example.
Note
There currently seems to be a backend bug - the job's
parentJobId
information is only returned when the jobs.list API endpoint is invoked with theparentJobId
filter, but not when fetching jobs with a different filter such asminCreationTime
.