From 842d8dec0961bd0ed54de075f31945a25914ba39 Mon Sep 17 00:00:00 2001 From: Michael Schmid Date: Mon, 3 Mar 2025 00:36:55 -0500 Subject: [PATCH] quote DailyTagSpend in order to look for the right View (#8947) PostgreSQL treats unquoted identifiers as lowercase by default. In our query, we're using "DailyTagSpend" (with capital letters), but PostgreSQL will be looking for "dailytagspend" (all lowercase). --- litellm/proxy/spend_tracking/spend_management_endpoints.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/proxy/spend_tracking/spend_management_endpoints.py b/litellm/proxy/spend_tracking/spend_management_endpoints.py index de540e1226a..9789e2a0ec1 100644 --- a/litellm/proxy/spend_tracking/spend_management_endpoints.py +++ b/litellm/proxy/spend_tracking/spend_management_endpoints.py @@ -2798,7 +2798,7 @@ async def ui_get_spend_by_tags( spend_date, log_count, total_spend - FROM DailyTagSpend + FROM "DailyTagSpend" WHERE spend_date >= $1::date AND spend_date <= $2::date ORDER BY total_spend DESC; """ @@ -2814,7 +2814,7 @@ async def ui_get_spend_by_tags( individual_request_tag, SUM(log_count) AS log_count, SUM(total_spend) AS total_spend - FROM DailyTagSpend + FROM "DailyTagSpend" WHERE spend_date >= $1::date AND spend_date <= $2::date AND individual_request_tag = ANY($3::text[]) GROUP BY individual_request_tag