[client] stream_measurements: parse native JSON booleans in measure values (_try_bool) #178
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
_try_bool(_streaming.py:65-70) only matches the strings"true"/"false":A native JSON boolean in a measure frame (
"value": true) silently yieldsvalue_bool=Noneon the emittedMeasurement. The stream is string-typed today, so this is hardening rather than a live bug — but the coercion is cheap and removes a silent-failure mode.Fix: accept booleans first:
Done when:
Measurement.from_measuremapsTrue/Falsevalues tovalue_bool, plus a unit test feeding a native boolean throughfrom_measure.