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
11 changes: 7 additions & 4 deletions dvc/commands/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
import logging
from typing import TYPE_CHECKING

from funcy import compact, log_durations
from funcy import chunks, compact, log_durations

from dvc.cli.command import CmdBase
from dvc.cli.utils import append_doc_link, fix_subparsers
from dvc.ui import ui
from dvc.utils import colorize

if TYPE_CHECKING:
from dvc.repo.data import Status as DataStatus
Expand Down Expand Up @@ -72,7 +73,7 @@ def _show_status(cls, status: "DataStatus") -> int:

label = cls.LABELS.get(stage, stage.capitalize() + " files")
header = f"{label}:"
color = cls.COLORS.get(stage, "normal")
color = cls.COLORS.get(stage, None)

ui.write(header)
if hint := cls.HINTS.get(stage):
Expand All @@ -86,8 +87,10 @@ def _show_status(cls, status: "DataStatus") -> int:
else:
items = stage_status

for item in items:
ui.write(f"\t[{color}]{item}[/]".expandtabs(8), styled=True)
tabs = "\t".expandtabs(8)
for chunk in chunks(1000, items):
out = "\n".join(tabs + item for item in chunk)
ui.write(colorize(out, color))

if (hint := cls.HINTS.get("git_dirty")) and git_info.get("is_dirty"):
message = hint.format("other " if result else "")
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/command/test_data_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from dvc.commands.data import CmdDataStatus
from dvc.repo import Repo
from dvc.repo.data import Status
from tests.func.parsing.test_errors import escape_ansi


@pytest.fixture
Expand Down Expand Up @@ -135,5 +136,5 @@ def test_show_status(dvc, scm, mocker, capsys, mocked_status, args, is_dirty):
expected_out += """\
(there are other changes not tracked by dvc, use "git status" to see)
"""
assert out == expected_out
assert escape_ansi(out) == expected_out
assert not err