Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exp diff: Remove --old option. #6888

Merged
merged 1 commit into from
Nov 12, 2021
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
7 changes: 0 additions & 7 deletions dvc/command/experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,6 @@ def run(self):
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,
Expand Down Expand Up @@ -1101,12 +1100,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",
Expand Down
24 changes: 23 additions & 1 deletion tests/unit/command/test_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def test_experiments_diff(dvc, scm, mocker):
"--param-deps",
"--json",
"--md",
"--old",
"--precision",
"10",
]
Expand All @@ -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(
[
Expand Down