Skip to content

Commit 79bc380

Browse files
committed
lint fix
1 parent ffd3724 commit 79bc380

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

aws-opentelemetry-distro/src/amazon/opentelemetry/distro/patches/_botocore_patches.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Modifications Copyright The OpenTelemetry Authors. Licensed under the Apache License 2.0 License.
44
import importlib
55
import json
6-
from typing import Any, Dict, Sequence
6+
from typing import Any, Dict, Optional, Sequence
77

88
from botocore.exceptions import ClientError
99

@@ -294,7 +294,9 @@ def patched_process_event(self, event):
294294

295295
old_process_event(self, event)
296296

297-
def patched_extract_tool_calls(message: dict[str, Any], capture_content: bool) -> Sequence[Dict[str, Any]] | None:
297+
def patched_extract_tool_calls(
298+
message: dict[str, Any], capture_content: bool
299+
) -> Optional[Sequence[Dict[str, Any]]]:
298300
content = message.get("content")
299301
if not content:
300302
return None

aws-opentelemetry-distro/tests/amazon/opentelemetry/distro/test_instrumentation_patch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ def _test_patched_bedrock_instrumentation(self):
482482
def _test_unpatched_extract_tool_calls(self):
483483
"""Test unpatched extract_tool_calls with string content throws AttributeError"""
484484
message_with_string_content = {"role": "assistant", "content": "{"}
485-
with self.assertRaises(AttributeError) as context:
485+
with self.assertRaises(AttributeError):
486486
bedrock_utils.extract_tool_calls(message_with_string_content, True)
487487

488488
def _test_unpatched_converse_stream_wrapper(self):

0 commit comments

Comments
 (0)