metrics: diff: handle deleted/new metric (#3529)

Partial fix for https://github.com/iterative/dvc/issues/3469
This commit is contained in:
Ruslan Kuprieiev
2020-03-25 05:23:21 +02:00
committed by GitHub
parent 9b38aa4680
commit 0bf6fdae14
3 changed files with 67 additions and 19 deletions
+18
View File
@@ -65,3 +65,21 @@ def test_metrics_diff_no_diff():
def test_metrics_diff_no_changes():
assert _show_diff({}) == "No changes."
def test_metrics_diff_new_metric():
assert _show_diff(
{"other.json": {"a.b.d": {"old": None, "new": "new"}}}
) == (
" Path Metric Value Change \n"
"other.json a.b.d new diff not supported"
)
def test_metrics_diff_deleted_metric():
assert _show_diff(
{"other.json": {"a.b.d": {"old": "old", "new": None}}}
) == (
" Path Metric Value Change \n"
"other.json a.b.d None diff not supported"
)