mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-16 23:41:43 +00:00
fix(proxy): handle None values in daily spend sort key (#16245)
Fixes TypeError when sorting daily spend transactions with missing entity IDs (e.g., null tags). Changed x[1].get(entity_id_field) to x[1].get(entity_id_field) or "" to provide a sortable default value when the field is None, preventing comparison errors between NoneType and str.
This commit is contained in:
parent
2ed95e216c
commit
7878ebd2a2
1 changed files with 1 additions and 1 deletions
|
|
@ -997,7 +997,7 @@ class DBSpendUpdateWriter:
|
|||
# should sort by the table first.
|
||||
key=lambda x: (
|
||||
x[1]["date"],
|
||||
x[1].get(entity_id_field),
|
||||
x[1].get(entity_id_field) or "",
|
||||
x[1]["api_key"],
|
||||
x[1]["model"],
|
||||
x[1]["custom_llm_provider"],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue