api: exp_show: Postprocess empty strings as None.

Makes it easier to manipulate when converting to pandas DataFrame.
This commit is contained in:
David de la Iglesia Castro
2023-05-08 17:10:27 +02:00
parent 8620b6e5af
commit 1ba3944944
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -83,6 +83,10 @@ def _postprocess(exp_rows):
exp_row[k] = float(v_str)
except ValueError:
exp_row[k] = v_str
if not exp_row[k]:
exp_row[k] = None
return exp_rows
+2
View File
@@ -30,3 +30,5 @@ def test_exp_show(tmp_dir, dvc, scm, exp_stage): # noqa: F811
assert exps[0]["metrics.yaml:foo"] == 1.0
# Postprocessing using `None` as fill value
assert exps[0]["State"] is None
# Postprocessing empty string as `None`
assert exps[0]["Experiment"] is None