Closed iPromKnight closed 2 weeks ago
[!CAUTION]
Review failed
The pull request is closed.
The changes in this pull request enhance the request handling and response parsing capabilities within the src/program/utils/request.py
file. Key updates include the introduction of retry policies and custom HTTP adapters, modifications to the BaseRequestHandler
and create_service_session
functions to accept new parameters, and improvements in error handling for various HTTP status codes. Additionally, new utility functions for creating retry policies and HTTP adapters have been added. The test suite in src/tests/test_rate_limiting.py
has also been updated with new fixtures and tests to validate these enhancements.
File | Change Summary |
---|---|
src/program/utils/request.py |
- Updated BaseRequestHandler constructor to accept additional parameters (custom exceptions, request logging). - Modified create_service_session to include session_adapter and retry_policy . - Added methods: get_retry_policy , get_http_adapter , _create_and_mount_session_adapter . - Enhanced ResponseObject and handle_response for better error handling. |
src/tests/test_rate_limiting.py |
- Added fixtures for retry_policy and connection_pool_params . - Introduced tests: test_session_adapter_configuration and test_session_adapter_pool_configuration_and_request to validate session adapter configurations and behavior. |
BaseRequestHandler
to manage rate limit exceptions and update the create_service_session
function to accommodate additional parameters related to rate limits, which directly relates to the modifications made in the main PR regarding session handling and error management for rate limits.🐇 In the meadow, I hop with glee,
New features added, oh what a spree!
With retries and adapters, we dance and play,
Improving our requests in a splendid way!
So let’s celebrate this code so bright,
A joyful leap in the moonlight! 🌙✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
create_service_session
.get_retry_policy
andget_http_adapter
functions for customizable retry and connection settings.Summary by CodeRabbit
New Features
Bug Fixes
Tests