diff --git a/dvc/command/metrics.py b/dvc/command/metrics.py index cfd1857ad..16e1287a2 100644 --- a/dvc/command/metrics.py +++ b/dvc/command/metrics.py @@ -16,9 +16,9 @@ def show_metrics(metrics, all_branches=False, all_tags=False): metrics (list): Where each element is either a `list` if an xpath was specified, otherwise a `str` """ - # When `metrics` contains a `_missing` key, it means that some files + # When `metrics` contains a `None` key, it means that some files # specified as `targets` in `repo.metrics.show` didn't contain any metrics. - missing = metrics.pop("_missing", None) + missing = metrics.pop(None, None) for branch, val in metrics.items(): if all_branches or all_tags: diff --git a/dvc/repo/metrics/show.py b/dvc/repo/metrics/show.py index 11935e899..cd1ab7459 100644 --- a/dvc/repo/metrics/show.py +++ b/dvc/repo/metrics/show.py @@ -276,12 +276,14 @@ def show( for branch in repo.brancher(all_branches=all_branches, all_tags=all_tags): metrics = {} - for p in targets: - entries = _collect_metrics(repo, p, recursive, typ, xpath, branch) + for target in targets: + entries = _collect_metrics( + repo, target, recursive, typ, xpath, branch + ) metric = _read_metrics(repo, entries, branch) if metric: - found.add(p) + found.add(target) metrics.update(metric) if metrics: @@ -293,6 +295,6 @@ def show( missing = set(targets) - found if missing: - res["_missing"] = missing + res[None] = missing return res