From ba4907caa7a64f2117c484f3bdeedf860404a780 Mon Sep 17 00:00:00 2001 From: jakeross Date: Mon, 29 Jun 2026 21:08:02 -0600 Subject: [PATCH] Coerce MCL exceedance value to float before comparison latest_value can be a str while mcl is a float, raising TypeError: '>' not supported between instances of 'str' and 'float'. Parse the value via _num() first; unparseable values yield no flag. Co-Authored-By: Claude Opus 4.8 --- backend/persisters/ogc_features.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/persisters/ogc_features.py b/backend/persisters/ogc_features.py index d9f36ea..495a559 100644 --- a/backend/persisters/ogc_features.py +++ b/backend/persisters/ogc_features.py @@ -418,7 +418,8 @@ def dump_mcl_exceedance_collection( # larger). If the data basis is NO3, this flag is wrong unless the # mcl in config/mcl.json is the as-NO3 value (~44.3 mg/L). Confirm # DIE's normalized nitrate basis before trusting nitrate exceedances. - exceeds = value is not None and mcl is not None and value > mcl + num = _num(value) + exceeds = num is not None and mcl is not None and num > mcl props[f"{analyte}_exceeds"] = exceeds if exceeds: exceeded.append(analyte)