-
Notifications
You must be signed in to change notification settings - Fork 6
Add request_timeout as a param for submit_image_query
#369
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
Conversation
submit_image_query to accept request_timeout through kwargsrequest_timeout as a param for submit_image_query
|
How does this differ from What happens if a user sets a Should this parameter be made available to convenience methods, such as |
This is how long the internal IQ submission API request will be attempted before giving up, e.g., in a scenario where there's no internet connection. So it's very 'internal workings' and doesn't really interact with the other parameters like In terms of making this available to other methods, this is being added for the edge to be able to use it and I don't really envision anyone else needing it/wanting to set it. When Brandon and I discussed, we thought it would be simplest to just add it to |
Okay, that makes sense. The part I was missing is that this governs the submission only; it's not a timeout for the whole function call. I think what you have in the docstring is fine. |
brandon-wada
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing the SDK under different network conditions is going to be a bit of a trickier task to look into in the future. This looks good though
| """ | ||
| with pytest.raises(ReadTimeoutError): | ||
| # Setting a very low request_timeout value should result in a timeout. | ||
| # NOTE: request_timeout=0 seems to have special behavior that does not result in a timeout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The urllib3 documentation is a little bit annoying about this, but the type on timeout is a float or None, so it wouldn't surprise me if there's some check on if timeout that falls back on some default wait time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm interesting, that definitely seems possible
No description provided.