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

feat(bigquery): add support for listing jobs by parent job #9225

Merged
merged 3 commits into from
Sep 27, 2019

Conversation

plamut
Copy link
Contributor

@plamut plamut commented Sep 13, 2019

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 the parent_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 the parentJobId filter, but not when fetching jobs with a different filter such as minCreationTime.

@plamut plamut added the api: bigquery Issues related to the BigQuery API. label Sep 13, 2019
@plamut plamut requested a review from a team September 13, 2019 13:35
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 13, 2019
@plamut
Copy link
Contributor Author

plamut commented Sep 13, 2019

The system test failure is because the scripting feature is not enabled for the test project.

@busunkim96
Copy link
Contributor

@shollyman is working on getting the project whitelisted.

@plamut
Copy link
Contributor Author

plamut commented Sep 19, 2019

@busunkim96 Great, thanks! Let me know when done, so that I can restart the tests.

@plamut plamut changed the title BigQuery: Add support for listing jobs by parent job feat(bigquery): add support for listing jobs by parent job Sep 24, 2019
@plamut
Copy link
Contributor Author

plamut commented Sep 24, 2019

It appears that the scripting feature has been enabled for the test project (the system test passes locally), re-running.

Edit: The failure now is flakiness, will make the test more robust.

@plamut plamut added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 24, 2019
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Sep 24, 2019
@plamut plamut merged commit c91eb11 into googleapis:master Sep 27, 2019
@plamut plamut deleted the iss-9190 branch September 27, 2019 08:17
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: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BigQuery: add parent_job parameter to list_jobs
5 participants