From e088a8e69eb8fe064bf1510a720d42abe159ab00 Mon Sep 17 00:00:00 2001 From: "Rodrigo Rodriguez (Pragmatismo)" Date: Tue, 7 Apr 2026 13:33:55 -0300 Subject: [PATCH] Update botmodels: anomaly detection fix --- src/api/v1/endpoints/anomaly.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/api/v1/endpoints/anomaly.py b/src/api/v1/endpoints/anomaly.py index ed16927..a3e3fe8 100644 --- a/src/api/v1/endpoints/anomaly.py +++ b/src/api/v1/endpoints/anomaly.py @@ -30,7 +30,14 @@ async def detect_anomalies( service = get_anomaly_service() - values = [float(r.get(request.value_field, 0)) for r in request.data] + values = [] + for r in request.data: + val = r.get(request.value_field) + if val is not None: + try: + values.append(float(val)) + except (TypeError, ValueError): + pass if not values: return {