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 as a code owner Oct 23, 2020
@google-cla google-cla bot added the cla: yes label Oct 23, 2020
Copy link
Contributor

@shollyman shollyman left a comment

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.

Loading

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

@shollyman shollyman Oct 27, 2020

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?

Loading

Copy link
Contributor Author

@tswast tswast Oct 28, 2020

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.

Loading

@tswast
Copy link
Contributor Author

@tswast 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().

Loading

@tswast
Copy link
Contributor Author

@tswast 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...

Loading

@gcf-merge-on-green gcf-merge-on-green bot merged commit e51fd45 into googleapis:master Oct 28, 2020
10 checks passed
Loading
@tswast tswast deleted the issue339-queryjob branch Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants