mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
api: make exp_show return float instead of None for zeroes
This commit is contained in:
committed by
Dave Berenbaum
parent
89b4beb7a4
commit
fc5147767f
@@ -53,7 +53,7 @@ def _postprocess(exp_rows):
|
||||
except ValueError:
|
||||
exp_row[k] = v_str
|
||||
|
||||
if not exp_row[k]:
|
||||
elif not exp_row[k]:
|
||||
exp_row[k] = None
|
||||
|
||||
return exp_rows
|
||||
|
||||
@@ -20,6 +20,8 @@ def test_exp_save(tmp_dir, dvc, scm):
|
||||
|
||||
|
||||
def test_exp_show(tmp_dir, dvc, scm, exp_stage): # noqa: F811
|
||||
with open("params.yaml", "a") as fobj:
|
||||
fobj.write("\nbar: 0")
|
||||
exps = api.exp_show()
|
||||
|
||||
assert len(exps) == 2
|
||||
@@ -32,3 +34,5 @@ def test_exp_show(tmp_dir, dvc, scm, exp_stage): # noqa: F811
|
||||
assert exps[0]["State"] is None
|
||||
# Postprocessing empty string as `None`
|
||||
assert exps[0]["Experiment"] is None
|
||||
# Postprocessing 0 as float
|
||||
assert exps[0]["bar"] == 0.0
|
||||
|
||||
Reference in New Issue
Block a user