diff --git a/dvc/commands/experiments/show.py b/dvc/commands/experiments/show.py index c00df5a4f..28580b876 100644 --- a/dvc/commands/experiments/show.py +++ b/dvc/commands/experiments/show.py @@ -426,11 +426,12 @@ def show_experiments( subset=subset, ) td.drop_duplicates("rows", subset=subset) - td.column("Experiment")[:] = [ - # remove tree characters - str(x).encode("ascii", "ignore").strip().decode() - for x in td.column("Experiment") - ] + if "Experiment" in td: + td.column("Experiment")[:] = [ + # remove tree characters + str(x).encode("ascii", "ignore").strip().decode() + for x in td.column("Experiment") + ] out = kwargs.get("out") or "dvc_plots" output_file = os.path.join(out, "index.html") ui.write( diff --git a/tests/func/experiments/test_show.py b/tests/func/experiments/test_show.py index a83b70ee3..efa7490e1 100644 --- a/tests/func/experiments/test_show.py +++ b/tests/func/experiments/test_show.py @@ -621,6 +621,10 @@ def test_show_parallel_coordinates(tmp_dir, dvc, scm, mocker, capsys): assert '"label": "Created"' not in html_text assert '"label": "foobar"' not in html_text + assert main(["exp", "show", "--pcp", "--drop", "Experiment"]) == 0 + html_text = (tmp_dir / "dvc_plots" / "index.html").read_text() + assert '"label": "Experiment"' not in html_text + def test_show_outs(tmp_dir, dvc, scm): tmp_dir.gen("copy.py", COPY_SCRIPT)