Closed
Conversation
There was a problem hiding this comment.
PR Overview
This PR introduces asynchronous HTTP client functionality along with examples, tests, and workflow updates to support the new async features. Key changes include:
- Addition of AsyncHttpClient and its corresponding usage examples in README.md and docs/examples.
- Inclusion of extensive tests in tests/test_async.py for async operations and retry logic.
- Updates to workflows and dependencies (e.g., Python version upgrade to 3.12 and addition of httpx).
Reviewed Changes
| File | Description |
|---|---|
| README.md | Added async usage instructions and code examples. |
| docs/examples/storage_client_async.py | New async storage client example. |
| docs/examples/poekapi_async.py | New async example for the Pokémon API (note potential typo). |
| docs/examples/storage_client.py | Synchronous storage client example. |
| docs/examples/pokeapi_process_multiple.py | Example demonstrating multiple async requests. |
| tests/test_async.py | Added tests covering async HTTP client behavior and retries. |
| src/keboola/http_client/async_client.py | Implementation of the AsyncHttpClient with retry logic. |
| src/keboola/http_client/http.py | Minor import adjustments. |
| setup.py | Updated dependencies and Python versions. |
| .github/workflows/*.yml | Upgraded Python version to 3.12 in CI/CD workflows. |
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
docs/examples/poekapi_async.py:1
- The filename 'poekapi_async.py' likely contains a typo; consider renaming it to 'pokeapi_async.py' for consistency with other examples.
Filename: poekapi_async.py
Comment on lines
+56
to
+58
| one_reqeust_per_second_amount = float(1 / max_requests_per_second) | ||
| self.limiter = AsyncLimiter(1, one_reqeust_per_second_amount) | ||
|
|
There was a problem hiding this comment.
The variable 'one_reqeust_per_second_amount' contains a spelling error; consider renaming it to 'one_request_per_second_amount'.
Suggested change
| one_reqeust_per_second_amount = float(1 / max_requests_per_second) | |
| self.limiter = AsyncLimiter(1, one_reqeust_per_second_amount) | |
| one_request_per_second_amount = float(1 / max_requests_per_second) | |
| self.limiter = AsyncLimiter(1, one_request_per_second_amount) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.