Skip to content

Commit 076bb79

Browse files
authored
fix: ruff formating fix & bump ruff version in dev requirements (#1600)
1 parent 014fd05 commit 076bb79

File tree

6 files changed

+16
-17
lines changed

6 files changed

+16
-17
lines changed

python/instrumentation/openinference-instrumentation-bedrock/src/openinference/instrumentation/bedrock/utils/anthropic/_messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def _attributes_from_message_param(
174174
pass # TODO
175175
else:
176176
if TYPE_CHECKING:
177-
assert_never(block)
177+
assert_never(block) # type: ignore[arg-type]
178178

179179

180180
@_stop_on_exception

python/instrumentation/openinference-instrumentation-bedrock/tests/openinference/instrumentation/bedrock/test_invoke_agent_instrumentor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def test_knowledge_base_results(
185185
tool_inputs_key = f"{tool_prefix}.{ToolCallAttributes.TOOL_CALL_FUNCTION_ARGUMENTS_JSON}"
186186
assert llm_span_attributes[tool_function_key] == "GET__x_amz_knowledgebase_HFUFBERTZV__Search"
187187
assert llm_span_attributes[tool_inputs_key] == (
188-
'{"searchQuery": "What is task decomposition? Provide a definition' ' and explanation."}'
188+
'{"searchQuery": "What is task decomposition? Provide a definition and explanation."}'
189189
)
190190

191191

python/instrumentation/openinference-instrumentation-openai-agents/src/openinference/instrumentation/openai_agents/_processor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,10 @@ def _get_attributes_from_input(
222222
if "type" not in item:
223223
if "role" in item and "content" in item:
224224
yield from _get_attributes_from_message_param(
225-
{
225+
{ # type: ignore[misc, arg-type]
226226
"type": "message",
227-
"role": item["role"],
228-
"content": item["content"],
227+
"role": item["role"], # type: ignore[typeddict-item]
228+
"content": item["content"], # type: ignore[typeddict-item]
229229
},
230230
prefix,
231231
)
@@ -252,7 +252,7 @@ def _get_attributes_from_input(
252252
elif item["type"] == "item_reference":
253253
continue # TODO
254254
elif TYPE_CHECKING:
255-
assert_never(item["type"])
255+
assert_never(item["type"]) # type: ignore[arg-type]
256256

257257

258258
def _get_attributes_from_message_param(

python/instrumentation/openinference-instrumentation-openai/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ testpaths = [
6969
[tool.mypy]
7070
strict = true
7171
explicit_package_bases = true
72+
warn_unused_ignores = false
7273
exclude = [
7374
"examples",
7475
"dist",

python/instrumentation/openinference-instrumentation-openai/src/openinference/instrumentation/openai/_attributes/_responses_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,8 @@ def _get_attributes_from_response_input_item_param(
333333
yield from cls._get_attributes_from_message_param(
334334
{
335335
"type": "message",
336-
"role": obj["role"],
337-
"content": obj["content"],
336+
"role": obj["role"], # type: ignore[typeddict-item]
337+
"content": obj["content"], # type: ignore[typeddict-item]
338338
},
339339
prefix,
340340
)
@@ -378,7 +378,7 @@ def _get_attributes_from_response_input_item_param(
378378
f"{prefix}{MessageAttributes.MESSAGE_TOOL_CALLS}.0.",
379379
)
380380
elif TYPE_CHECKING:
381-
assert_never(obj["type"])
381+
assert_never(obj["type"]) # type: ignore[arg-type]
382382

383383
@classmethod
384384
@stop_on_exception

python/instrumentation/openinference-instrumentation-openai/tests/openinference/instrumentation/openai/test_instrumentor.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -598,15 +598,13 @@ def responses_mock_stream() -> Tuple[List[bytes], List[Dict[str, Any]]]:
598598
)
599599

600600

601-
def get_response_messages() -> (
602-
List[
603-
Tuple[
604-
List[Dict[str, Any]],
605-
List[Dict[str, Any]],
606-
Tuple[List[bytes], List[Dict[str, Any]]],
607-
]
601+
def get_response_messages() -> List[
602+
Tuple[
603+
List[Dict[str, Any]],
604+
List[Dict[str, Any]],
605+
Tuple[List[bytes], List[Dict[str, Any]]],
608606
]
609-
):
607+
]:
610608
messages: List[
611609
Tuple[
612610
List[Dict[str, Any]],

0 commit comments

Comments
 (0)