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
3 changes: 3 additions & 0 deletions dvc/command/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ def _show_diff(diff):

table = Texttable()

# disable automatic formatting
table.set_cols_dtype(["t", "t", "t", "t"])

# remove borders to make it easier for users to copy stuff
table.set_chars(("", "", "", ""))
table.set_deco(0)
Expand Down
9 changes: 9 additions & 0 deletions tests/unit/command/test_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,12 @@ def test_metrics_show(dvc, mocker):
all_branches=True,
all_commits=True,
)


def test_metrics_diff_prec():
assert _show_diff(
{"other.json": {"a.b": {"old": 0.0042, "new": 0.0043, "diff": 0.0001}}}
) == (
" Path Metric Value Change\n"
"other.json a.b 0.0043 0.0001"
)