Skip to content

Commit 2f15f30

Browse files
committed
exp run: do not log message twice on workspace executor
Fixes #7276.
1 parent 47d10c4 commit 2f15f30

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

dvc/repo/experiments/executor/manager/local.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def exec_queue(
8888
rev=rev,
8989
infofile=infofile,
9090
log_level=logger.getEffectiveLevel(),
91+
log_errors=not isinstance(executor, WorkspaceExecutor),
9192
)
9293
if not exec_result.exp_hash:
9394
raise DvcException(

tests/func/experiments/test_experiments.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from dvc.exceptions import DvcException
1111
from dvc.repo.experiments.utils import exp_refs_by_rev
1212
from dvc.scm import resolve_rev
13+
from dvc.stage.exceptions import StageFileDoesNotExistError
1314
from dvc.utils.serialize import PythonFileCorruptedError
1415
from tests.func.test_repro_multistage import COPY_SCRIPT
1516

@@ -704,3 +705,15 @@ def test_experiment_name_invalid(tmp_dir, scm, dvc, exp_stage, mocker):
704705
params=["foo=3"],
705706
)
706707
new_mock.assert_not_called()
708+
709+
710+
def test_experiments_workspace_not_log_exception(caplog, dvc, scm):
711+
"""Experiments run in workspace should not log exception.
712+
713+
Instead it should just leave it to be handled in the main entrypoints.
714+
"""
715+
with caplog.at_level(logging.ERROR):
716+
with pytest.raises(StageFileDoesNotExistError):
717+
dvc.experiments.run()
718+
719+
assert not caplog.text

0 commit comments

Comments
 (0)