mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-07-25 12:01:04 +02:00
fix: cast usage run filter JSON values to Float instead of Integer (#574)
The duration and tokenUsage numberRange filters cast the JSON text value to INTEGER, but some rows store call_duration_seconds as a JSON float (0.0, written by get_call_duration when the pipeline never recorded a start time). Postgres cannot cast the text '0.0' to integer, so any duration filter on /organizations/usage/runs failed with InvalidTextRepresentationError. Cast to FLOAT instead, matching the duration sort clause, and make get_call_duration return an int so new rows are written as integers. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
eae30b3b21
commit
cd20607628
2 changed files with 10 additions and 11 deletions
|
|
@ -113,10 +113,10 @@ class PipelineMetricsAggregator(FrameProcessor):
|
|||
"""Get the aggregated STT usage metrics grouped by processor|||model."""
|
||||
return self._stt_usage_metrics
|
||||
|
||||
def get_call_duration(self) -> float:
|
||||
def get_call_duration(self) -> int:
|
||||
"""Get call duration"""
|
||||
if self._start_time is None:
|
||||
return 0.0
|
||||
return 0
|
||||
|
||||
if self._stop_time is None:
|
||||
call_duration = time.time() - self._start_time
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue