mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 07:18:28 +01:00
api: exp_show: Postprocess empty strings as None.
Makes it easier to manipulate when converting to pandas DataFrame.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user