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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add minimum timeout to getQueryResults API requests #444

Merged
merged 7 commits into from Jan 8, 2021

Conversation

@tswast
Copy link
Contributor

@tswast tswast commented Dec 21, 2020

Since successful responses can still take a long time to download, have
a minimum timeout which should accomodate 99.9%+ of responses.

I figure it's more important that any timeout is set if desired than
it is that the specific timeout is used. This is especially true in
cases where a short timeout is requested for the purposes of a progress
bar. Making forward progress is more important than the progress bar
update frequency.

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #438 馃

Since successful responses can still take a long time to download, have
a minimum timeout which should accomodate 99.9%+ of responses.

I figure it's more important that *any* timeout is set if desired than
it is that the specific timeout is used.  This is especially true in
cases where a short timeout is requested for the purposes of a progress
bar. Making forward progress is more important than the progress bar
update frequency.
@tswast tswast requested a review from as a code owner Dec 21, 2020
@tswast tswast requested review from shollyman and removed request for Dec 21, 2020
@google-cla google-cla bot added the cla: yes label Dec 21, 2020
@tswast tswast requested a review from steffnay Dec 21, 2020
Copy link
Contributor

@shollyman shollyman left a comment

one minor question about documenting behavior.

Loading

@@ -3307,6 +3318,9 @@ def _list_rows_from_query_results(
"location": location,
}

if timeout is not None:
timeout = max(timeout, _MIN_GET_QUERY_RESULTS_TIMEOUT)
Copy link
Contributor

@shollyman shollyman Jan 5, 2021

Choose a reason for hiding this comment

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

Should we document this in the methods? e.g. timeout less than the _MIN_GET_QUERY_RESULTS_TIMEOUT are ignored?

Loading

@tswast tswast merged commit 015a73e into googleapis:master Jan 8, 2021
10 of 11 checks passed
Loading
@tswast tswast deleted the issue438-getQueryResults-timeout branch Jan 8, 2021
shollyman added a commit to shollyman/python-bigquery that referenced this issue Feb 12, 2021
鈥m/python-docs-samples#444)

Put them in their own directory, since they duplicate the content from
the existing samples that use the generated libraries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants