From 6cf194f85f95f8672d1f2c8aab7de9cda8d9375d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Redzy=C5=84ski?= Date: Mon, 26 Oct 2020 19:05:55 +0100 Subject: [PATCH] plot: fix no metrics data detection (#4764) --- dvc/repo/plots/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dvc/repo/plots/__init__.py b/dvc/repo/plots/__init__.py index 2748baa5b..5ae87abd6 100644 --- a/dvc/repo/plots/__init__.py +++ b/dvc/repo/plots/__init__.py @@ -84,7 +84,8 @@ class Plots: # If any mentioned plot doesn't have any data then that's an error targets = [targets] if isinstance(targets, str) else targets or [] for target in targets: - if not any("data" in d[target] for d in data.values()): + rpath = relpath(target, self.repo.root_dir) + if not any("data" in d[rpath] for d in data.values()): raise NoMetricInHistoryError(target) # No data at all is a special error with a special message