capo-sagemaker-runtime-http2 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {capo_sagemaker_runtime_http2-0.2.0/src/capo_sagemaker_runtime_http2.egg-info → capo_sagemaker_runtime_http2-0.3.0}/PKG-INFO +1 -1
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/pyproject.toml +1 -1
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_operations/amazon_sage_maker_runtime_http2/invoke_endpoint_with_bidirectional_stream.py +3 -2
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_services/_pipeline.py +17 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0/src/capo_sagemaker_runtime_http2.egg-info}/PKG-INFO +1 -1
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/LICENSE +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/README.md +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/setup.cfg +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/__init__.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_async.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_auth/_identity.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_auth/_providers.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_auth/_signers.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_auth/_sigv4.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_auth/_zapros_handler.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_body.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_iter.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_pagination.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_protocol/__init__.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_protocol/errors.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_protocol/eventstream.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_protocol/serialize.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_protocol/xml.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_rule_engine/__init__.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_rule_engine/_aws_partition.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_rule_engine/_endpoint_rule_set.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_rule_engine/_endpoint_runtime.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_services/_aws_config.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_services/async_sage_maker_runtime_http2.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/_services/sage_maker_runtime_http2.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/errors/__init__.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/errors/_base.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/errors/input_validation_error.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/errors/internal_server_error.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/errors/internal_stream_failure.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/errors/model_error.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/errors/model_stream_error.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/errors/service_unavailable_error.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/py.typed +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/types/_prelude/blob.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/types/_prelude/timestamp.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/types/invoke_endpoint_with_bidirectional_stream_input.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/types/invoke_endpoint_with_bidirectional_stream_output.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/types/request_payload_part.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/types/request_stream_event.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/types/response_payload_part.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/types/response_stream_event.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2/types/sensitive_blob.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2.egg-info/SOURCES.txt +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2.egg-info/dependency_links.txt +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2.egg-info/requires.txt +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/src/capo_sagemaker_runtime_http2.egg-info/top_level.txt +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/tests/test_body.py +0 -0
- {capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/tests/test_sigv4.py +0 -0
|
@@ -36,6 +36,7 @@ from capo_sagemaker_runtime_http2._rule_engine._endpoint_rule_set import (
|
|
|
36
36
|
from capo_sagemaker_runtime_http2._services._pipeline import (
|
|
37
37
|
AsyncOperationOptions,
|
|
38
38
|
OperationOptions,
|
|
39
|
+
raise_error,
|
|
39
40
|
)
|
|
40
41
|
from capo_sagemaker_runtime_http2.errors import UnknownServiceError
|
|
41
42
|
|
|
@@ -239,7 +240,7 @@ def invoke_endpoint_with_bidirectional_stream(
|
|
|
239
240
|
try:
|
|
240
241
|
if response.status >= 300:
|
|
241
242
|
response.read()
|
|
242
|
-
|
|
243
|
+
raise_error(response, handle_error)
|
|
243
244
|
return handle_response(response), response
|
|
244
245
|
except BaseException:
|
|
245
246
|
response.close()
|
|
@@ -259,7 +260,7 @@ async def async_invoke_endpoint_with_bidirectional_stream(
|
|
|
259
260
|
try:
|
|
260
261
|
if response.status >= 300:
|
|
261
262
|
await response.aread()
|
|
262
|
-
|
|
263
|
+
raise_error(response, handle_error)
|
|
263
264
|
return await async_handle_response(response), response
|
|
264
265
|
except BaseException:
|
|
265
266
|
await response.aclose()
|
|
@@ -6,6 +6,7 @@ from collections.abc import AsyncIterator, Iterator, Sequence
|
|
|
6
6
|
from dataclasses import dataclass
|
|
7
7
|
from typing import TYPE_CHECKING, Awaitable, Callable, Generic, TypeVar, cast
|
|
8
8
|
|
|
9
|
+
from typing_extensions import Never
|
|
9
10
|
from zapros import (
|
|
10
11
|
AsyncClient,
|
|
11
12
|
Client,
|
|
@@ -135,6 +136,22 @@ async def aexecute_pipeline(
|
|
|
135
136
|
return await make_chain(0)(request)
|
|
136
137
|
|
|
137
138
|
|
|
139
|
+
def raise_error(response: Response, handle_error: Callable[[Response], Never]) -> Never:
|
|
140
|
+
try:
|
|
141
|
+
handle_error(response)
|
|
142
|
+
except ServiceError as exc:
|
|
143
|
+
# The response itself can say a retry is safe, even when the error is
|
|
144
|
+
# not marked @retryable: a 429, a transient 5xx or a Retry-After header.
|
|
145
|
+
if response.status == 429:
|
|
146
|
+
exc.is_throttling_error = True
|
|
147
|
+
if (
|
|
148
|
+
response.status in (429, 500, 502, 503, 504)
|
|
149
|
+
or "retry-after" in response.headers
|
|
150
|
+
):
|
|
151
|
+
exc.is_retryable = True
|
|
152
|
+
raise
|
|
153
|
+
|
|
154
|
+
|
|
138
155
|
def _is_retryable(exc: Exception) -> bool:
|
|
139
156
|
if isinstance(exc, ServiceError):
|
|
140
157
|
return exc.is_retryable
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/tests/test_body.py
RENAMED
|
File without changes
|
{capo_sagemaker_runtime_http2-0.2.0 → capo_sagemaker_runtime_http2-0.3.0}/tests/test_sigv4.py
RENAMED
|
File without changes
|