Skip to content

Commit 4102f20

Browse files
fix: rename retriable to retryable for spell checker compliance
1 parent eb2016b commit 4102f20

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/a2a/client/transports/retry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@
4242

4343

4444
def default_retry_predicate(error: Exception) -> bool: # noqa: PLR0911
45-
"""Determines if an error is retriable based on its type and cause.
45+
"""Determines if an error is retryable based on its type and cause.
4646
47-
Retriable conditions:
47+
Retryable conditions:
4848
- A2AClientTimeoutError (always)
4949
- A2AClientError caused by httpx.RequestError (network errors)
5050
- A2AClientError caused by httpx.HTTPStatusError with status 429, 502, 503, 504
5151
- A2AClientError caused by grpc.aio.AioRpcError with UNAVAILABLE or RESOURCE_EXHAUSTED
5252
53-
Non-retriable:
53+
Non-retryable:
5454
- Domain-specific errors (TaskNotFoundError, etc.) — inherit A2AError, not A2AClientError
5555
- A2AClientError caused by json.JSONDecodeError or SSEError
5656
- A2AClientError with no recognized __cause__

tests/client/transports/test_retry.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ def retry_transport(mock_transport: AsyncMock) -> RetryTransport:
6363

6464

6565
class TestDefaultRetryPredicate:
66-
def test_timeout_error_is_retriable(self) -> None:
66+
def test_timeout_error_is_retryable(self) -> None:
6767
error = A2AClientTimeoutError('timeout')
6868
assert default_retry_predicate(error) is True
6969

70-
def test_network_error_is_retriable(self) -> None:
70+
def test_network_error_is_retryable(self) -> None:
7171
cause = httpx.ConnectError('connection refused')
7272
error = A2AClientError(
7373
'Network communication error: connection refused'
@@ -76,7 +76,7 @@ def test_network_error_is_retriable(self) -> None:
7676
assert default_retry_predicate(error) is True
7777

7878
@pytest.mark.parametrize('status_code', [429, 502, 503, 504])
79-
def test_retriable_http_status_codes(self, status_code: int) -> None:
79+
def test_retryable_http_status_codes(self, status_code: int) -> None:
8080
request = httpx.Request('POST', 'http://example.com')
8181
response = httpx.Response(status_code, request=request)
8282
cause = httpx.HTTPStatusError(
@@ -87,7 +87,7 @@ def test_retriable_http_status_codes(self, status_code: int) -> None:
8787
assert default_retry_predicate(error) is True
8888

8989
@pytest.mark.parametrize('status_code', [400, 401, 403, 404, 500])
90-
def test_non_retriable_http_status_codes(self, status_code: int) -> None:
90+
def test_non_retryable_http_status_codes(self, status_code: int) -> None:
9191
request = httpx.Request('POST', 'http://example.com')
9292
response = httpx.Response(status_code, request=request)
9393
cause = httpx.HTTPStatusError(
@@ -97,25 +97,25 @@ def test_non_retriable_http_status_codes(self, status_code: int) -> None:
9797
error.__cause__ = cause
9898
assert default_retry_predicate(error) is False
9999

100-
def test_json_decode_error_is_not_retriable(self) -> None:
100+
def test_json_decode_error_is_not_retryable(self) -> None:
101101
cause = json.JSONDecodeError('msg', 'doc', 0)
102102
error = A2AClientError('JSON Decode Error')
103103
error.__cause__ = cause
104104
assert default_retry_predicate(error) is False
105105

106-
def test_domain_error_is_not_retriable(self) -> None:
106+
def test_domain_error_is_not_retryable(self) -> None:
107107
error = TaskNotFoundError()
108108
assert default_retry_predicate(error) is False
109109

110-
def test_internal_error_is_not_retriable(self) -> None:
110+
def test_internal_error_is_not_retryable(self) -> None:
111111
error = InternalError()
112112
assert default_retry_predicate(error) is False
113113

114-
def test_client_error_without_cause_is_not_retriable(self) -> None:
114+
def test_client_error_without_cause_is_not_retryable(self) -> None:
115115
error = A2AClientError('some error')
116116
assert default_retry_predicate(error) is False
117117

118-
def test_non_a2a_error_is_not_retriable(self) -> None:
118+
def test_non_a2a_error_is_not_retryable(self) -> None:
119119
error = ValueError('not an A2A error')
120120
assert default_retry_predicate(error) is False
121121

@@ -216,7 +216,7 @@ async def test_no_retry_on_domain_error(
216216
assert mock_transport.get_task.call_count == 1
217217

218218
@pytest.mark.asyncio
219-
async def test_no_retry_on_non_retriable_http_status(
219+
async def test_no_retry_on_non_retryable_http_status(
220220
self,
221221
mock_transport: AsyncMock,
222222
retry_transport: RetryTransport,
@@ -419,7 +419,7 @@ async def test_custom_retry_predicate(
419419
assert mock_transport.get_task.call_count == 2
420420

421421
@pytest.mark.asyncio
422-
async def test_custom_predicate_rejects_normally_retriable(
422+
async def test_custom_predicate_rejects_normally_retryable(
423423
self, mock_transport: AsyncMock
424424
) -> None:
425425
transport = RetryTransport(

0 commit comments

Comments
 (0)