feat: enhance normalization of metric values for improved handling
- Updated `_normalize_metric_value_for_read` to compact numeric strings and ensure consistent formatting for string data types. - Enhanced `normalize_prompt_number` to handle numeric strings and non-finite float values effectively. - Improved unit tests to validate the new normalization behavior for session metrics and scalar formatting.
This commit is contained in:
1 parent
178534e9eb
commit
7676897fda
4 files changed
+64
-10
No files matched your search
@@ -24,7 +24,7 @@ def _normalize_metric_value_for_read(data_type: str, val: Any) -> Any:
|
||||
return None
|
||||
dt = (data_type or "").strip().lower()
|
||||
if dt == "string":
|
||||
return val
|
||||
return normalize_prompt_number(val)
|
||||
if dt == "boolean":
|
||||
return bool(val)
|
||||
if dt == "integer":
|
||||
|
||||
Reference in new issue
Block a user