params: diff: sort table (#3617)

This commit is contained in:
Ruslan Kuprieiev
2020-04-09 21:23:18 +03:00
committed by GitHub
parent cdef709e8a
commit 0e854f9534
2 changed files with 22 additions and 2 deletions
+5 -2
View File
@@ -1,6 +1,8 @@
import argparse
import logging
from collections import OrderedDict
from dvc.command.base import append_doc_link
from dvc.command.base import CmdBase
from dvc.command.base import fix_subparsers
@@ -14,8 +16,9 @@ def _show_diff(diff):
from dvc.utils.diff import table
rows = []
for fname, mdiff in diff.items():
for param, change in mdiff.items():
for fname, pdiff in diff.items():
sorted_pdiff = OrderedDict(sorted(pdiff.items()))
for param, change in sorted_pdiff.items():
rows.append([fname, param, change["old"], change["new"]])
return table(["Path", "Param", "Old", "New"], rows)