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

Update documentation for job.waitFor #1444

Open
anthavio opened this issue Jul 13, 2021 · 2 comments
Open

Update documentation for job.waitFor #1444

anthavio opened this issue Jul 13, 2021 · 2 comments
Assignees
Labels
api: bigquery Issues related to the googleapis/java-bigquery API. documentation Improvements or additions to documentation

Comments

@anthavio
Copy link
Contributor

anthavio commented Jul 13, 2021

After this commit com.google.cloud.bigquery.Job.waitFor behavior changed significantly.
It starts to throws JobException/BigQueryException when there is any execution error in Job in reload method

However in many javadoc places and example code, following workflow is suggested, which does won't work anymore because BigQueryException is now being thrown in reload()

Job completedJob = job.waitFor();
 if (completedJob == null) {
   // job no longer exists
 } else if (completedJob.getStatus().getError() != null) {
   // job failed, handle error
 } else {
   // job completed successfully
 }

Also method header

public Job reload(JobOption... options)

and

public Job waitFor(RetryOption... waitOptions) throws InterruptedException

should contain

throws BigQueryException

I was much happier with previous way of dealing with job execution errors, but I assume it is too late to revert it back, so at least documentation should be right

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/java-bigquery API. label Jul 13, 2021
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jul 14, 2021
@stephaniewang526 stephaniewang526 self-assigned this Jul 14, 2021
@stephaniewang526 stephaniewang526 added type: question Request for information or clarification. Not an issue. and removed triage me I really want to be triaged. labels Jul 14, 2021
@stephaniewang526 stephaniewang526 removed their assignment Aug 22, 2021
@anthavio
Copy link
Contributor Author

anthavio commented Nov 3, 2021

Here are location suggesting no longer working code
https://github.com/googleapis/java-bigquery/search?q=Job+completed+successfully

@stephaniewang526
Copy link
Contributor

Hi, please feel free to open a PR with suggested changes. I will review it. Thanks!

@meredithslota meredithslota added documentation Improvements or additions to documentation and removed type: question Request for information or clarification. Not an issue. labels Jul 11, 2022
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 googleapis/java-bigquery API. documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

5 participants