From 37761a2627c1e41c35c03e55cd5284d2f4f1386d Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Tue, 21 Feb 2023 12:06:56 +0200 Subject: [PATCH] data: status: get rid of --not-in-remote --- dvc/commands/data.py | 7 ------- dvc/repo/data.py | 3 +-- tests/func/test_data_status.py | 6 ++---- tests/unit/command/test_data_status.py | 1 - 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/dvc/commands/data.py b/dvc/commands/data.py index d9565f67c..2cd92189a 100644 --- a/dvc/commands/data.py +++ b/dvc/commands/data.py @@ -117,7 +117,6 @@ class CmdDataStatus(CmdBase): status = self.repo.data_status( granular=self.args.granular, untracked_files=self.args.untracked_files, - not_in_remote=self.args.not_in_remote, remote_refresh=self.args.remote_refresh, ) @@ -244,12 +243,6 @@ def add_parser(subparsers, parent_parser): nargs="?", help="Show untracked files.", ) - data_status_parser.add_argument( - "--not-in-remote", - action="store_true", - default=False, - help="Show files missing from remote.", - ) data_status_parser.add_argument( "--remote-refresh", action="store_true", diff --git a/dvc/repo/data.py b/dvc/repo/data.py index beed6c25d..278a2f027 100644 --- a/dvc/repo/data.py +++ b/dvc/repo/data.py @@ -172,6 +172,7 @@ def _diff_index_to_wtree(repo: "Repo", **kwargs: Any) -> Dict[str, List[str]]: repo.index.data["repo"], workspace, not_in_cache=True, + not_in_remote=True, **kwargs, ) @@ -223,7 +224,6 @@ def _transform_git_paths_to_dvc(repo: "Repo", files: Iterable[str]) -> List[str] def status( repo: "Repo", untracked_files: str = "no", - not_in_remote: bool = False, **kwargs: Any, ) -> Status: from dvc.scm import NoSCMError, SCMError @@ -231,7 +231,6 @@ def status( head = kwargs.pop("head", "HEAD") uncommitted_diff = _diff_index_to_wtree( repo, - not_in_remote=not_in_remote, **kwargs, ) unchanged = set(uncommitted_diff.pop("unchanged", [])) diff --git a/tests/func/test_data_status.py b/tests/func/test_data_status.py index 8f81310fc..b9cb1edea 100644 --- a/tests/func/test_data_status.py +++ b/tests/func/test_data_status.py @@ -402,7 +402,7 @@ def test_missing_remote_cache(M, tmp_dir, dvc, scm, local_remote): tmp_dir.dvc_gen({"dir": {"foo": "foo", "bar": "bar"}}) tmp_dir.dvc_gen("foobar", "foobar") - assert dvc.data_status(untracked_files="all", not_in_remote=True) == { + assert dvc.data_status(untracked_files="all") == { **EMPTY_STATUS, "untracked": M.unordered("foobar.dvc", "dir.dvc", ".gitignore"), "committed": {"added": M.unordered("foobar", join("dir", ""))}, @@ -410,9 +410,7 @@ def test_missing_remote_cache(M, tmp_dir, dvc, scm, local_remote): "git": M.dict(), } - assert dvc.data_status( - granular=True, untracked_files="all", not_in_remote=True - ) == { + assert dvc.data_status(granular=True, untracked_files="all") == { **EMPTY_STATUS, "untracked": M.unordered("foobar.dvc", "dir.dvc", ".gitignore"), "committed": { diff --git a/tests/unit/command/test_data_status.py b/tests/unit/command/test_data_status.py index b28d4f903..6a1f388bd 100644 --- a/tests/unit/command/test_data_status.py +++ b/tests/unit/command/test_data_status.py @@ -51,7 +51,6 @@ def test_cli(dvc, mocker, mocked_status): assert cmd.run() == 0 status.assert_called_once_with( untracked_files="all", - not_in_remote=False, remote_refresh=False, granular=True, )