Skip to content

Commit 17c9d4c

Browse files
committed
fix: clean unit test
1 parent e7ad3a9 commit 17c9d4c

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

src/sagemaker/explainer/clarify_explainer_config.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,7 @@
1717

1818

1919
class ClarifyTextConfig(object):
20-
"""Configuration for natural language processing (NLP) explainability.
21-
22-
A parameter used to configure the SageMaker Clarify explainer to treat text features as text
23-
so that explanations are provided for individual units of text. Required only for NLP
24-
explainability.
25-
"""
20+
"""A parameter used to configure the SageMaker Clarify explainer to treat text features as text so that explanations are provided for individual units of text. Required only for NLP explainability.""" # noqa E501 # pylint: disable=line-too-long
2621

2722
def __init__(
2823
self,

tests/unit/test_predictor.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
CSV_RETURN_VALUE = "1,2,3\r\n"
3333
PRODUCTION_VARIANT_1 = "PRODUCTION_VARIANT_1"
3434
INFERENCE_ID = "inference-id"
35-
ENABLE_EXPLANATIONS = "`true`"
3635

3736
ENDPOINT_DESC = {"EndpointArn": "foo", "EndpointConfigName": ENDPOINT}
3837

@@ -125,29 +124,6 @@ def test_predict_call_with_inference_id():
125124
assert result == RETURN_VALUE
126125

127126

128-
def test_predict_call_with_enable_explanations():
129-
sagemaker_session = empty_sagemaker_session()
130-
predictor = Predictor(ENDPOINT, sagemaker_session)
131-
132-
data = "untouched"
133-
result = predictor.predict(data, enable_explanations=ENABLE_EXPLANATIONS)
134-
135-
assert sagemaker_session.sagemaker_runtime_client.invoke_endpoint.called
136-
137-
expected_request_args = {
138-
"Accept": DEFAULT_ACCEPT,
139-
"Body": data,
140-
"ContentType": DEFAULT_CONTENT_TYPE,
141-
"EndpointName": ENDPOINT,
142-
"EnableExplanations": ENABLE_EXPLANATIONS,
143-
}
144-
145-
call_args, kwargs = sagemaker_session.sagemaker_runtime_client.invoke_endpoint.call_args
146-
assert kwargs == expected_request_args
147-
148-
assert result == RETURN_VALUE
149-
150-
151127
def test_multi_model_predict_call():
152128
sagemaker_session = empty_sagemaker_session()
153129
predictor = Predictor(ENDPOINT, sagemaker_session)

0 commit comments

Comments
 (0)