From 1174e3e3581bc5780c18b12aba9dc40b940c60f2 Mon Sep 17 00:00:00 2001 From: yucheng-berriai Date: Tue, 23 Jun 2026 17:51:41 -0700 Subject: [PATCH] style: drop redundant quotes from type annotations (UP037) fan_out.py uses 'from __future__ import annotations', so string-quoted annotations are unnecessary; ruff UP037 flagged 8 across fan_out.py and routing.py and the strict-rule delta gate counted them as new. Unquote them. --- litellm/integrations/otel/plumbing/fan_out.py | 12 ++++++------ litellm/integrations/otel/plumbing/routing.py | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/litellm/integrations/otel/plumbing/fan_out.py b/litellm/integrations/otel/plumbing/fan_out.py index a1e6b060be1..9fbf97cee40 100644 --- a/litellm/integrations/otel/plumbing/fan_out.py +++ b/litellm/integrations/otel/plumbing/fan_out.py @@ -42,7 +42,7 @@ if TYPE_CHECKING: _MAX_CACHED_PROCESSORS = 256 -def _processor_key(destination: "OtelDestination") -> tuple: +def _processor_key(destination: OtelDestination) -> tuple: return (destination.endpoint, tuple(sorted(destination.headers.items()))) @@ -58,9 +58,9 @@ class TenantFanOutSpanProcessor(SpanProcessor): self._owner = owner_callback_name # Built lazily so we avoid importing the providers module at class # definition time (which would create a circular import with routing). - self._processors: "OrderedDict[tuple, SpanProcessor]" = OrderedDict() + self._processors: OrderedDict[tuple, SpanProcessor] = OrderedDict() - def on_start(self, span: "Span", parent_context: Context | None = None) -> None: + def on_start(self, span: Span, parent_context: Context | None = None) -> None: return None def on_end(self, span: ReadableSpan) -> None: @@ -115,7 +115,7 @@ class TenantFanOutSpanProcessor(SpanProcessor): all_ok = False return all_ok - def _processor_for(self, destination: "OtelDestination") -> "SpanProcessor | None": + def _processor_for(self, destination: OtelDestination) -> SpanProcessor | None: key = _processor_key(destination) cached = self._processors.get(key) if cached is not None: @@ -171,7 +171,7 @@ def _is_genai_span(span: ReadableSpan) -> bool: # Backend-specific Resource attributes required by the destination. Arize # rejects spans missing ``model_id`` (or the alternative ``arize.project.name`` # span attribute); other backends accept the proxy's default Resource. -def _destination_resource_attrs(destination: "OtelDestination") -> dict[str, str]: +def _destination_resource_attrs(destination: OtelDestination) -> dict[str, str]: if destination.callback_name == "arize": project = os.environ.get("ARIZE_PROJECT_NAME") if project: @@ -180,7 +180,7 @@ def _destination_resource_attrs(destination: "OtelDestination") -> dict[str, str def _with_destination_resource( - span: ReadableSpan, destination: "OtelDestination" + span: ReadableSpan, destination: OtelDestination ) -> ReadableSpan: """Return ``span`` with its Resource augmented by the destination's required attributes. The original span object is left untouched; a shallow wrapper diff --git a/litellm/integrations/otel/plumbing/routing.py b/litellm/integrations/otel/plumbing/routing.py index 4af06d2f91a..7beffc66a86 100644 --- a/litellm/integrations/otel/plumbing/routing.py +++ b/litellm/integrations/otel/plumbing/routing.py @@ -61,7 +61,7 @@ class TenantTracerCache: self._config = config self._callback_name = callback_name self._tracer_name = tracer_name - self._providers: "OrderedDict[tuple[tuple[str, tuple[tuple[str, str], ...]], ...], TracerProvider]" = (OrderedDict()) + self._providers: OrderedDict[tuple[tuple[str, tuple[tuple[str, str], ...]], ...], TracerProvider] = (OrderedDict()) def tracer_for( self, default: Tracer, destinations: "tuple[OtelDestination, ...]"