diff --git a/dvc/command/experiments/show.py b/dvc/command/experiments/show.py index 4f27419f0..759d53391 100644 --- a/dvc/command/experiments/show.py +++ b/dvc/command/experiments/show.py @@ -373,7 +373,7 @@ def prepare_exp_id(kwargs) -> "RichText": def baseline_styler(typ): - return {"style": "bold"} if typ == "baseline" else {} + return {"style": "bold"} if typ == "baseline" else {"style": "default"} def show_experiments( @@ -437,6 +437,9 @@ def show_experiments( td.drop(col) row_styles = lmap(baseline_styler, td.column("typ")) + for n, row_style in enumerate(row_styles): + if n % 2 != 0: + row_style["style"] += " on grey23" if not csv: merge_headers = ["Experiment", "rev", "typ", "parent"] @@ -471,7 +474,7 @@ def show_experiments( td.render( pager=pager, - borders=True, + borders="horizontals", rich_table=True, header_styles=styles, row_styles=row_styles, diff --git a/dvc/ui/table.py b/dvc/ui/table.py index a08216f1c..2a204f26d 100644 --- a/dvc/ui/table.py +++ b/dvc/ui/table.py @@ -91,6 +91,7 @@ def rich_table( False: None, "simple": box.SIMPLE, "minimal": box.MINIMAL, + "horizontals": box.HORIZONTALS, } table = Table(box=border_style[borders]) diff --git a/tests/func/experiments/test_show.py b/tests/func/experiments/test_show.py index c5e314f62..f8d95ff0a 100644 --- a/tests/func/experiments/test_show.py +++ b/tests/func/experiments/test_show.py @@ -293,7 +293,6 @@ def test_show_filter( from dvc.ui import ui capsys.readouterr() - div = "│" if os.name == "nt" else "┃" tmp_dir.gen("copy.py", COPY_SCRIPT) params_file = tmp_dir / "params.yaml" @@ -340,11 +339,11 @@ def test_show_filter( cap = capsys.readouterr() for i in included: - assert f"{div} params.yaml:{i} {div}" in cap.out - assert f"{div} metrics.yaml:{i} {div}" in cap.out + assert f"params.yaml:{i}" in cap.out + assert f"metrics.yaml:{i}" in cap.out for e in excluded: - assert f"{div} params.yaml:{e} {div}" not in cap.out - assert f"{div} metrics.yaml:{e} {div}" not in cap.out + assert f"params.yaml:{e}" not in cap.out + assert f"metrics.yaml:{e}" not in cap.out def test_show_multiple_commits(tmp_dir, scm, dvc, exp_stage):