Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Allows clients to pass in an HTTP Session (#59)
<!-- begin-generated-description --> This pull request introduces changes to the `__init__` method of the `compass.py` module, which is responsible for initializing a compass client to interact with the Compass API. The modifications primarily involve updating the handling of the `default_timeout` and introducing a new `http_session` parameter. ## Changes: - The `default_timeout` parameter's type hint has been updated from `int` to `int | None`, indicating that it can now accept `None` as a valid value. - A new parameter, `http_session`, has been added to the `__init__` method, allowing for the specification of an HTTP session with a custom timeout. - The instantiation of the `SessionWithDefaultTimeout` class has been replaced with a conditional assignment, setting `self.session` to either the provided `http_session` or a new instance of `requests.Session()`. - A warning message is logged if `default_timeout` is not `None`, indicating that the variable is deprecated and will not have any effect. This message also provides guidance on using the `http_session` parameter for specifying HTTP request timeouts. <!-- end-generated-description -->
- Loading branch information