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: add reload argument to *Job.done() functions #341

Merged
merged 5 commits into from
Oct 28, 2020

Conversation

tswast
Copy link
Contributor

@tswast tswast commented Oct 23, 2020

This enables checking the job status without making an API call.

It also fixes an inconsistency in QueryJob, where a job can be
reported as "done" without having the results of a getQueryResults API
call.

Follow-up to #340

This enables checking the job status without making an API call.

It also fixes an inconsistency in `QueryJob`, where a job can be
reported as "done" without having the results of a `getQueryResults` API
call.
@tswast tswast requested a review from a team October 23, 2020 20:04
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 23, 2020
Copy link
Contributor

@shollyman shollyman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the changes here indicate there's further changes for registering the done callback? My mental model has them independent, but I wanted to make sure.

is_done = (
# Only consider a QueryJob complete when we know we have the final
# query results available.
self._query_results is not None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checking: What about DDL statements, where we have no results? Or would this already retain the empty row iterator?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DDL statements don't 404 for jobs.getQueryResults, do they? This is the full response object of jobs.getQueryResults, not just the rows.

@tswast
Copy link
Contributor Author

tswast commented Oct 28, 2020

Do the changes here indicate there's further changes for registering the done callback?

No callbacks here. Maybe when we implement the async client #18

done does get called by result via PollingFuture._blocking_poll, which is why I can now remove the extra call to _get_query_results from QueryJob.result().

@tswast
Copy link
Contributor Author

tswast commented Oct 28, 2020

Do the changes here indicate there's further changes for registering the done callback?

Maybe you meant -- How do we get the needed arguments to get_query_results from result? I'm planning to do something a little bit hacky in https://github.com/googleapis/python-bigquery/pull/347/files -- which maybe is a bad idea, as it means you can't call result from two threads simultaneously. Hmmm...

@tswast tswast added the automerge Merge the pull request once unit tests and other checks pass. label Oct 28, 2020
@gcf-merge-on-green gcf-merge-on-green bot merged commit e51fd45 into googleapis:master Oct 28, 2020
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Oct 28, 2020
@tswast tswast deleted the issue339-queryjob branch November 3, 2020 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants