mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix: guard against None litellm_metadata in batch logging (#20832)
When litellm_metadata is explicitly set to None in litellm_params,
`dict.get("litellm_metadata", {})` returns None (not the default {}),
because the key exists. The subsequent .get() call on None raises
`AttributeError: 'NoneType' object has no attribute 'get'`.
Use `or {}` instead, consistent with line 4924 in the same file.
Fixes #15836
This commit is contained in:
parent
68d2306dd4
commit
99b4d17ee8
1 changed files with 1 additions and 1 deletions
|
|
@ -2331,7 +2331,7 @@ class Logging(LiteLLMLoggingBaseClass):
|
|||
result, LiteLLMBatch
|
||||
):
|
||||
litellm_params = self.litellm_params or {}
|
||||
litellm_metadata = litellm_params.get("litellm_metadata", {})
|
||||
litellm_metadata = litellm_params.get("litellm_metadata") or {}
|
||||
if (
|
||||
litellm_metadata.get("batch_ignore_default_logging", False) is True
|
||||
): # polling job will query these frequently, don't spam db logs
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue