Skip to content

Commit b7888fe

Browse files
committed
Please pylint
1 parent e769362 commit b7888fe

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

instrumentation/opentelemetry-instrumentation-botocore/src/opentelemetry/instrumentation/botocore/extensions/bedrock.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def _extract_metrics_attributes(self) -> _AttributeMapT:
149149

150150
model_id = self._call_context.params.get(_MODEL_ID_KEY)
151151
if not model_id:
152-
return
152+
return attributes
153153

154154
attributes[GEN_AI_REQUEST_MODEL] = model_id
155155

@@ -335,9 +335,10 @@ def before_service_call(
335335
span.update_name(f"{operation_name} {request_model}")
336336

337337
# this is used to calculate the operation duration metric, duration may be skewed by request_hook
338+
# pylint: disable=attribute-defined-outside-init
338339
self._operation_start = default_timer()
339340

340-
# pylint: disable=no-self-use
341+
# pylint: disable=no-self-use,too-many-locals
341342
def _converse_on_success(
342343
self,
343344
span: Span,
@@ -546,7 +547,7 @@ def invoke_model_stream_error_callback(exception):
546547
)
547548
return
548549

549-
# pylint: disable=no-self-use
550+
# pylint: disable=no-self-use,too-many-locals
550551
def _handle_amazon_titan_response(
551552
self,
552553
span: Span,
@@ -607,7 +608,7 @@ def _handle_amazon_titan_response(
607608
output_tokens, output_attributes
608609
)
609610

610-
# pylint: disable=no-self-use
611+
# pylint: disable=no-self-use,too-many-locals
611612
def _handle_amazon_nova_response(
612613
self,
613614
span: Span,

instrumentation/opentelemetry-instrumentation-botocore/tests/test_botocore_bedrock.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def test_converse_with_content(
5656
bedrock_runtime_client,
5757
instrument_with_content,
5858
):
59+
# pylint:disable=too-many-locals
5960
messages = [{"role": "user", "content": [{"text": "Say this is a test"}]}]
6061

6162
llm_model_value = "amazon.titan-text-lite-v1"

0 commit comments

Comments
 (0)