exp show: add internal --no-fetch option to disable temp/queue ref fetch

This commit is contained in:
Peter Rowlands
2022-04-21 15:45:59 +09:00
committed by Peter Rowlands (변기호)
parent ba82faee53
commit 444bf27e6f
4 changed files with 12 additions and 3 deletions
+7
View File
@@ -480,6 +480,7 @@ class CmdExperimentsShow(CmdBase):
num=self.args.num,
sha_only=self.args.sha,
param_deps=self.args.param_deps,
fetch_running=self.args.fetch_running,
)
except DvcException:
logger.exception("failed to show experiments")
@@ -645,4 +646,10 @@ def add_parser(experiments_subparsers, parent_parser):
default=False,
help="Open the Parallel Coordinates Plot directly in the browser.",
)
experiments_show_parser.add_argument(
"--no-fetch",
dest="fetch_running",
action="store_false",
help=argparse.SUPPRESS,
)
experiments_show_parser.set_defaults(func=CmdExperimentsShow)
+2 -2
View File
@@ -742,7 +742,7 @@ class Experiments:
return self.stash_revs[rev].name
return None
def get_running_exps(self) -> Dict[str, int]:
def get_running_exps(self, fetch_refs: bool = True) -> Dict[str, int]:
"""Return info for running experiments."""
from dvc.scm import InvalidRemoteSCMRepo
from dvc.utils.serialize import load_json
@@ -774,7 +774,7 @@ class Experiments:
result[rev] = info.asdict()
else:
result[rev] = info.asdict()
if info.git_url:
if info.git_url and fetch_refs:
def on_diverged(_ref: str, _checkpoint: bool):
return False
+2 -1
View File
@@ -136,6 +136,7 @@ def show(
num=1,
param_deps=False,
onerror: Optional[Callable] = None,
fetch_running: bool = True,
):
if onerror is None:
@@ -153,7 +154,7 @@ def show(
iter_revs(repo.scm, revs, num, all_branches, all_tags, all_commits)
)
running = repo.experiments.get_running_exps()
running = repo.experiments.get_running_exps(fetch_refs=fetch_running)
for rev in found_revs:
res[rev]["baseline"] = _collect_experiment_commit(
+1
View File
@@ -118,6 +118,7 @@ def test_experiments_show(dvc, scm, mocker):
revs="foo",
sha_only=True,
param_deps=True,
fetch_running=True,
)