diff --git a/src/dvclive/live.py b/src/dvclive/live.py index 348825a1..ee046fa5 100644 --- a/src/dvclive/live.py +++ b/src/dvclive/live.py @@ -466,7 +466,7 @@ def cache(self, path): return # skip caching logger.warning( f"To track '{path}' automatically during `dvc exp run`:" - f"\n1. Run `dvc exp remove {existing_stage.addressing}` " + f"\n1. Run `dvc remove {existing_stage.addressing}` " "to stop tracking it outside the pipeline." "\n2. Add it as an output of the pipeline stage." ) diff --git a/tests/test_log_artifact.py b/tests/test_log_artifact.py index f6468025..5c6443ac 100644 --- a/tests/test_log_artifact.py +++ b/tests/test_log_artifact.py @@ -250,7 +250,7 @@ def test_log_artifact_inside_exp(tmp_dir, mocker, dvc_repo, tracked): elif tracked == "data_source": msg = ( "To track 'data' automatically during `dvc exp run`:" - "\n1. Run `dvc exp remove data.dvc` " + "\n1. Run `dvc remove data.dvc` " "to stop tracking it outside the pipeline." "\n2. Add it as an output of the pipeline stage." ) @@ -263,3 +263,24 @@ def test_log_artifact_inside_exp(tmp_dir, mocker, dvc_repo, tracked): ) logger.warning.assert_called_with(msg) spy.assert_called_once() + + +def test_log_artifact_inside_exp_subdir(tmp_dir, mocker, dvc_repo): + logger = mocker.patch("dvclive.live.logger") + subdir = tmp_dir / "subdir" + subdir.mkdir() + data = subdir / "data" + data.touch() + dvc_repo.add(subdir) + live = Live() + spy = mocker.spy(live._dvc_repo, "add") + live._inside_dvc_exp = True + live.log_artifact("subdir/data") + msg = ( + "To track 'subdir/data' automatically during `dvc exp run`:" + "\n1. Run `dvc remove subdir.dvc` " + "to stop tracking it outside the pipeline." + "\n2. Add it as an output of the pipeline stage." + ) + logger.warning.assert_called_with(msg) + spy.assert_called_once()