From a945c093bb89521c75be840bf877d3ded6d1fd03 Mon Sep 17 00:00:00 2001 From: apex-mochen <2756823972@qq.com> Date: Fri, 9 Oct 2026 13:28:15 +0000 Subject: [PATCH] fix(otel): keep the raw-span redaction guard inside the type gate The guard added two basedpyright diagnostics over the merge-base counts: reportUnknownVariableType on the import of the callee (whose own signature is untyped upstream) and reportUnknownArgumentType on the untyped request kwargs. Suppress both on their reported lines with a reason, the shape the repo's LIT004 rule requires; no behavior change. Signed-off-by: apex-mochen <2756823972@qq.com> --- litellm/integrations/opentelemetry.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/litellm/integrations/opentelemetry.py b/litellm/integrations/opentelemetry.py index 4e7df367072..2c58542ceec 100644 --- a/litellm/integrations/opentelemetry.py +++ b/litellm/integrations/opentelemetry.py @@ -1491,9 +1491,11 @@ class OpenTelemetry(OTELGenAISemconvMixin, CustomLogger): # to keep out of traces still leaks through the raw span. This uses the # same precedence as the main span (dynamic param > redaction headers > # global turn_off_message_logging). - from litellm.litellm_core_utils.redact_messages import should_redact_message_logging + from litellm.litellm_core_utils.redact_messages import ( + should_redact_message_logging, # pyright: ignore[reportUnknownVariableType] # callee is untyped upstream + ) - if should_redact_message_logging(kwargs): + if should_redact_message_logging(kwargs): # pyright: ignore[reportUnknownArgumentType] # untyped by design return litellm_params: Final = kwargs.get("litellm_params", {}) metadata: Final = litellm_params.get("metadata") or {}