Skip to content

Conversation

@kudj
Copy link

@kudj kudj commented Mar 10, 2025

No description provided.

@kudj kudj requested review from AlbSed and Copilot March 10, 2025 14:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

PR Overview

This PR refactors the asynchronous HTTP client's retry mechanism by broadening the exception handling and adjusting error message formatting. Key changes include:

  • Expanding the exceptions caught during retries to include additional httpx errors.
  • Updating the error message formatting and handling logic when retries are exhausted.
  • Adjusting test assertions to reflect new error message formats.

Reviewed Changes

File Description
src/keboola/http_client/async_client.py Updated _request exception handling to catch a broader set of exceptions and modify error messages based on retry attempts.
tests/test_async.py Adjusted test assertions to match updated error message expectations.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

src/keboola/http_client/async_client.py:163

  • The test expects an error message starting with 'Client error' for HTTPStatusError when the retry limit is reached, but the current logic simply raises the original HTTPStatusError without modifying its message. Consider wrapping or reformatting the message to consistently reflect the updated error message format.
if retry_attempt == self.retries:

Copy link
Contributor

@soustruh soustruh left a comment

Choose a reason for hiding this comment

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

This too much of a black magic to handle one exception, I've never EVER in my life see an except clause spanned over 27 lines. 🙀 I beg you, please add an extensive comment either in the code or in the PR description to explain why is this important. 🙏

Copy link
Contributor

@soustruh soustruh left a comment

Choose a reason for hiding this comment

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

AFter discussing it in person, let's merge this and simplify the logic in the merged branch with all the async code

@kudj kudj merged commit 3883c6a into feature/async Sep 25, 2025
1 check passed
@kudj kudj deleted the feature/async-retry branch September 25, 2025 07:25
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.

2 participants