Skip to content

Commit c325750

Browse files
committed
fix: linting problems
1 parent fe39a23 commit c325750

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/uipath_llamaindex/_cli/_tracing/_attribute_normalizer.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77

88
import json
99
import logging
10+
from collections.abc import Mapping
1011
from typing import Any, Optional
1112

1213
from opentelemetry.context import Context
13-
from opentelemetry.sdk.trace import ReadableSpan, Span, SpanProcessor
14+
from opentelemetry.sdk.trace import Span, SpanProcessor
15+
from opentelemetry.util.types import AttributeValue
1416

1517
logger = logging.getLogger(__name__)
1618

@@ -25,14 +27,14 @@ def on_start(self, span: Span, parent_context: Optional[Context] = None) -> None
2527
"""Called when span starts - no action needed."""
2628
pass
2729

28-
def on_end(self, span: ReadableSpan) -> None:
30+
def on_end(self, span: Span) -> None:
2931
"""Normalize tool call attributes before span is consumed by exporters/terminal."""
3032
if not span._attributes:
3133
return
3234

3335
try:
3436
# Get the mutable internal attributes dict
35-
attrs: dict = span._attributes # type: ignore[attr-defined]
37+
attrs: Mapping[str, AttributeValue] = span._attributes
3638

3739
if attrs.get("openinference.span.kind", None) == "TOOL":
3840
# Normalize tool call attributes
@@ -46,7 +48,7 @@ def on_end(self, span: ReadableSpan) -> None:
4648
if logger.isEnabledFor(logging.DEBUG):
4749
logger.debug(
4850
f"Normalized {key} in span '{span.name}': "
49-
f"{original[:50]}... → {normalized[:50]}..."
51+
f"{str(original)[:50]}... → {str(normalized)[:50]}..."
5052
)
5153

5254
except Exception as e:

0 commit comments

Comments
 (0)