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>
This commit is contained in:
apex-mochen 2026-10-09 13:28:15 +00:00
parent a6c01e051e
commit a945c093bb

View file

@ -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 {}