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

Allow SDK methods to accept request_timeout through kwargs #332

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

CoreyEWood
Copy link
Contributor

No description provided.

Comment on lines 282 to +284
def get_detector_by_name(self, name: str) -> Detector:
# TODO should methods like this (which make direct requests instead of going through the API) allow
# kwargs to be passed through?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here's one type of tricky case for allowing request_timeout to be specified.

@@ -960,6 +986,9 @@ def wait_for_confident_result(
confidence_threshold: Optional[float] = None,
timeout_sec: float = 30.0,
) -> ImageQuery:
# TODO should this method allow request_timeout to be passed in kwargs?
# It's a weird case because it might make multiple requests - would the specified request_timeout be applied
# to each request?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is another tricky case for accepting request_timeout.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

An overall question: is there a sensible way to test this for all the methods we want to enable request_timeout through kwargs for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant