From 5ceffa5efed809deb309734f89f4552883f458e5 Mon Sep 17 00:00:00 2001 From: David de la Iglesia Castro Date: Mon, 21 Nov 2022 18:19:19 +0100 Subject: [PATCH] save: Fix `experiments.get_exact_name` usage. --- dvc/commands/experiments/save.py | 2 +- tests/func/experiments/test_save.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dvc/commands/experiments/save.py b/dvc/commands/experiments/save.py index 1b8a398ce3..2c7f3763fe 100644 --- a/dvc/commands/experiments/save.py +++ b/dvc/commands/experiments/save.py @@ -23,7 +23,7 @@ def run(self): if self.args.json: ui.write_json({"ref": ref}) else: - name = self.repo.experiments.get_exact_name(ref) + name = self.repo.experiments.get_exact_name([ref])[ref] ui.write(f"Experiment has been saved as: {name}") ui.write( "\nTo promote an experiment to a Git branch run:\n\n" diff --git a/tests/func/experiments/test_save.py b/tests/func/experiments/test_save.py index 82a7197873..227b43a827 100644 --- a/tests/func/experiments/test_save.py +++ b/tests/func/experiments/test_save.py @@ -18,7 +18,7 @@ def test_exp_save(tmp_dir, dvc, scm, exp_stage, name): assert ref_info and ref_info.baseline_sha == baseline exp_name = name if name else ref_info.name - assert dvc.experiments.get_exact_name(exp) == exp_name + assert dvc.experiments.get_exact_name([exp])[exp] == exp_name assert resolve_rev(scm, exp_name) == exp