mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
exp diff: Remove --old option.
After #6814 the header of `diff_table` is `a_rev/`b_rev` instead of `Old`/`New` so the name of the option was counterintuitive. In addition, make `a_rev` show by default, for consistency with output format of other `diff_table` uses (`dvc metrics diff` / `dvc params diff`).
This commit is contained in:
committed by
Ruslan Kuprieiev
parent
ef9d8580cc
commit
28dd39a1a0
@@ -587,7 +587,6 @@ class CmdExperimentsDiff(CmdBase):
|
||||
title=title,
|
||||
markdown=self.args.markdown,
|
||||
no_path=self.args.no_path,
|
||||
old=self.args.old,
|
||||
on_empty_diff="diff not supported",
|
||||
precision=precision if key == "metrics" else None,
|
||||
a_rev=self.args.a_rev,
|
||||
@@ -1114,12 +1113,6 @@ def add_parser(subparsers, parent_parser):
|
||||
dest="markdown",
|
||||
help="Show tabulated output in the Markdown format (GFM).",
|
||||
)
|
||||
experiments_diff_parser.add_argument(
|
||||
"--old",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Show old ('a_rev') metric/param value.",
|
||||
)
|
||||
experiments_diff_parser.add_argument(
|
||||
"--no-path",
|
||||
action="store_true",
|
||||
|
||||
@@ -46,7 +46,6 @@ def test_experiments_diff(dvc, scm, mocker):
|
||||
"--param-deps",
|
||||
"--json",
|
||||
"--md",
|
||||
"--old",
|
||||
"--precision",
|
||||
"10",
|
||||
]
|
||||
@@ -63,6 +62,29 @@ def test_experiments_diff(dvc, scm, mocker):
|
||||
)
|
||||
|
||||
|
||||
def test_experiments_diff_revs(mocker, capsys):
|
||||
mocker.patch(
|
||||
"dvc.repo.experiments.diff.diff",
|
||||
return_value={
|
||||
"params": {
|
||||
"params.yaml": {"foo": {"diff": 1, "old": 1, "new": 2}}
|
||||
},
|
||||
"metrics": {
|
||||
"metrics.yaml": {"foo": {"diff": 1, "old": 1, "new": 2}}
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
cli_args = parse_args(["exp", "diff", "exp_a", "exp_b"])
|
||||
cmd = cli_args.func(cli_args)
|
||||
|
||||
capsys.readouterr()
|
||||
assert cmd.run() == 0
|
||||
cap = capsys.readouterr()
|
||||
assert "exp_a" in cap.out
|
||||
assert "exp_b" in cap.out
|
||||
|
||||
|
||||
def test_experiments_show(dvc, scm, mocker):
|
||||
cli_args = parse_args(
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user