Skip to content

Commit 339ed2a

Browse files
authored
Attempt to convert results to numeric types (#567)
Split out from #557 - [ ] Add test case
1 parent 9067014 commit 339ed2a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: mlos_bench/mlos_bench/environments/local/local_env.py

+2
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ def run(self) -> Tuple[Status, Optional[Dict[str, float]]]:
191191
if list(data.columns) == ["metric", "value"]:
192192
_LOG.info("Local results have (metric,value) header and %d rows: assume long format", len(data))
193193
data = pandas.DataFrame([data.value.to_list()], columns=data.metric.to_list())
194+
# Try to convert string metrics to numbers.
195+
data = data.apply(pandas.to_numeric, errors="ignore") # type: ignore[assignment] # (false positive)
194196
elif len(data) == 1:
195197
_LOG.info("Local results have 1 row: assume wide format")
196198
else:

0 commit comments

Comments
 (0)