From 72eeba1c2a7888e38d8ccb39cc351ade81228660 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 21 Jul 2026 18:30:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20GROUP=20BY=20currency=E5=8A=A0=E8=A1=A8?= =?UTF-8?q?=E5=89=8D=E7=BC=80dm=5Fmodel=5Fcall=5Ffact=E6=B6=88=E9=99=A4amb?= =?UTF-8?q?iguous=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sage_datamart/dashboards.py | 2 +- sage_datamart/etl.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sage_datamart/dashboards.py b/sage_datamart/dashboards.py index 63d3bd3..08412bf 100644 --- a/sage_datamart/dashboards.py +++ b/sage_datamart/dashboards.py @@ -191,7 +191,7 @@ async def get_currency_breakdown(env, sor): COALESCE(SUM(amount_cny), 0) as amount_cny FROM dm_model_call_fact WHERE call_date = ${today}$ - GROUP BY currency + GROUP BY dm_model_call_fact.currency ORDER BY call_count DESC""" recs = await sor.sqlExe(sql, {'today': env.curDateString()}) return [{ diff --git a/sage_datamart/etl.py b/sage_datamart/etl.py index cc31984..2f9698a 100644 --- a/sage_datamart/etl.py +++ b/sage_datamart/etl.py @@ -178,7 +178,7 @@ async def aggregate_daily_perf(sor, stat_date=None): SUM(amount) as total_amount FROM dm_model_call_fact WHERE call_date = ${stat_date}$ - GROUP BY call_date, llmid, model, catelogid, providerid, ownerid, userorgid, currency + GROUP BY call_date, llmid, model, catelogid, providerid, ownerid, userorgid, dm_model_call_fact.currency """ rows = await sor.sqlExe(sql, {'stat_date': stat_date}) info('sage_datamart AGG: aggregating ' + str(len(rows)) + ' groups for ' + stat_date) @@ -236,7 +236,7 @@ async def aggregate_provider_cost(sor, stat_date=None): AVG(ttft_ms) as avg_ttft FROM dm_model_call_fact WHERE call_date = ${stat_date}$ - GROUP BY model, providerid, currency + GROUP BY model, providerid, dm_model_call_fact.currency """ rows = await sor.sqlExe(sql, {'stat_date': stat_date})