Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dvclive/live.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)
Expand Down
23 changes: 22 additions & 1 deletion tests/test_log_artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
)
Expand All @@ -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()