From 536966f9d1bbe339c40963ce95195369b565e4b3 Mon Sep 17 00:00:00 2001 From: Alexander Schepanovski Date: Mon, 1 Jun 2020 20:19:11 +0700 Subject: [PATCH] Fix modifying plot (#3926) - no error when modifying plot with no props yet - do not turn into non-plot if all props are unset --- dvc/repo/plots/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dvc/repo/plots/__init__.py b/dvc/repo/plots/__init__.py index 1a440d5e0..11681368a 100644 --- a/dvc/repo/plots/__init__.py +++ b/dvc/repo/plots/__init__.py @@ -18,13 +18,17 @@ class Plots: (out,) = self.repo.find_outs_by_path(path) # This out will become a plot unless it is one already - if not out.plot: + if not isinstance(out.plot, dict): out.plot = {} for field in unset or (): out.plot.pop(field, None) out.plot.update(props or {}) + # Empty dict will move it to non-plots + if not out.plot: + out.plot = True + out.verify_metric() dvcfile = Dvcfile(self.repo, out.stage.path)