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:
Alexsander Hamir 2025-11-04 15:56:48 -08:00 committed by GitHub
parent 2ed95e216c
commit 7878ebd2a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"],