Skip to content

Commit 7a92636

Browse files
committed
nit
1 parent ebdcc2e commit 7a92636

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

integrations/amazon_bedrock/tests/test_chat_generator.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from haystack_integrations.common.amazon_bedrock.errors import AmazonBedrockInferenceError
1515
from haystack_integrations.components.generators.amazon_bedrock import AmazonBedrockChatGenerator
16+
from haystack_integrations.components.generators.amazon_bedrock.chat.chat_generator import MAX_RETRIES
1617

1718
CLASS_TYPE = "haystack_integrations.components.generators.amazon_bedrock.chat.chat_generator.AmazonBedrockChatGenerator"
1819
MODELS_TO_TEST = [
@@ -1267,8 +1268,6 @@ def test_run_raises_on_non_throttling_client_error(self, mock_boto3_session, set
12671268

12681269
def test_run_raises_after_max_retries_exhausted(self, mock_boto3_session, set_env_variables):
12691270
"""After MAX_RETRIES throttling errors the error is propagated."""
1270-
from haystack_integrations.components.generators.amazon_bedrock.chat.chat_generator import MAX_RETRIES
1271-
12721271
generator = AmazonBedrockChatGenerator(model="anthropic.claude-3-5-sonnet-20240620-v1:0")
12731272
mock_client = mock_boto3_session.return_value.client.return_value
12741273
mock_client.converse.side_effect = _make_client_error("ThrottlingException")
@@ -1351,8 +1350,6 @@ async def test_run_async_raises_on_non_throttling_client_error(self, mock_boto3_
13511350
@pytest.mark.asyncio
13521351
async def test_run_async_raises_after_max_retries_exhausted(self, mock_boto3_session, mock_aioboto3_session):
13531352
"""After MAX_RETRIES throttling errors the error is propagated in async mode."""
1354-
from haystack_integrations.components.generators.amazon_bedrock.chat.chat_generator import MAX_RETRIES
1355-
13561353
generator = AmazonBedrockChatGenerator(model="anthropic.claude-3-5-sonnet-20240620-v1:0")
13571354

13581355
mock_async_client = AsyncMock()

integrations/amazon_bedrock/tests/test_generator.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
MetaLlamaAdapter,
2121
MistralAdapter,
2222
)
23+
from haystack_integrations.components.generators.amazon_bedrock.generator import MAX_RETRIES
2324

2425

2526
@pytest.mark.parametrize("boto3_config", [None, {"read_timeout": 1000}])
@@ -1822,8 +1823,6 @@ def test_run_raises_on_non_throttling_client_error(self, mock_boto3_session):
18221823

18231824
def test_run_raises_after_max_retries_exhausted(self, mock_boto3_session):
18241825
"""After MAX_RETRIES throttling errors the error is propagated."""
1825-
from haystack_integrations.components.generators.amazon_bedrock.generator import MAX_RETRIES
1826-
18271826
generator = AmazonBedrockGenerator(model="anthropic.claude-v2")
18281827
mock_client = mock_boto3_session.return_value.client.return_value
18291828
mock_client.invoke_model.side_effect = _make_client_error("ThrottlingException")

0 commit comments

Comments
 (0)