mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-13 08:52:02 +00:00
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:
parent
a6c01e051e
commit
a945c093bb
1 changed files with 4 additions and 2 deletions
|
|
@ -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 {}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue