Skip to content

Commit 6f23668

Browse files
authored
chore!: remove deprecated BedrockRanker (use AmazonBedrockRanker instead) (#2287)
* chore: remove legacy BedrockRanker (use AmazonBedrockRanker instead) * fmt
1 parent d0d47d2 commit 6f23668

File tree

3 files changed

+4
-22
lines changed

3 files changed

+4
-22
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from .ranker import AmazonBedrockRanker, BedrockRanker
1+
from .ranker import AmazonBedrockRanker
22

3-
__all__ = ["AmazonBedrockRanker", "BedrockRanker"]
3+
__all__ = ["AmazonBedrockRanker"]

integrations/amazon_bedrock/src/haystack_integrations/components/rankers/amazon_bedrock/ranker.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import warnings
21
from typing import Any, Dict, List, Optional
32

43
from botocore.exceptions import ClientError
@@ -265,20 +264,3 @@ def resolve_secret(secret: Optional[Secret]) -> Optional[str]:
265264
except Exception as exception:
266265
msg = f"Error during Amazon Bedrock API call: {exception}"
267266
raise AmazonBedrockInferenceError(msg) from exception
268-
269-
270-
class BedrockRanker(AmazonBedrockRanker):
271-
"""
272-
Deprecated alias for AmazonBedrockRanker.
273-
This class will be removed in a future version.
274-
Please use AmazonBedrockRanker instead.
275-
"""
276-
277-
def __init__(self, *args, **kwargs):
278-
warnings.warn(
279-
"BedrockRanker is deprecated and will be removed in a future version. "
280-
"Please use AmazonBedrockRanker instead.",
281-
DeprecationWarning,
282-
stacklevel=2,
283-
)
284-
super().__init__(*args, **kwargs)

integrations/amazon_bedrock/tests/test_ranker.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from haystack_integrations.common.amazon_bedrock.errors import (
88
AmazonBedrockInferenceError,
99
)
10-
from haystack_integrations.components.rankers.amazon_bedrock import AmazonBedrockRanker, BedrockRanker
10+
from haystack_integrations.components.rankers.amazon_bedrock import AmazonBedrockRanker
1111

1212

1313
@pytest.fixture
@@ -31,7 +31,7 @@ def test_amazon_bedrock_ranker_initialization(mock_aws_session):
3131

3232

3333
def test_bedrock_ranker_run(mock_aws_session):
34-
ranker = BedrockRanker(
34+
ranker = AmazonBedrockRanker(
3535
model="cohere.rerank-v3-5:0",
3636
top_k=2,
3737
aws_access_key_id=Secret.from_token("test_access_key"),

0 commit comments

Comments
 (0)