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/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from .data.transfer import transfer as otransfer
from .data.tree import Tree
from .fs import get_cloud_fs
from .fs.base import RemoteMissingDepsError
from .fs.hdfs import HDFSFileSystem
from .fs.local import LocalFileSystem
from .fs.s3 import S3FileSystem
Expand Down Expand Up @@ -871,6 +872,8 @@ def _collect_used_dir_cache(

try:
self.get_dir_cache(jobs=jobs, remote=remote)
except RemoteMissingDepsError:
raise
except DvcException:
logger.debug(f"failed to pull cache for '{self}'")

Expand Down
19 changes: 19 additions & 0 deletions tests/unit/output/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
from funcy import first
from voluptuous import MultipleInvalid, Schema

from dvc.fs.base import RemoteMissingDepsError
from dvc.ignore import _no_match
from dvc.output import CHECKSUM_SCHEMA, Output
from dvc.stage import Stage
from dvc.utils.fs import remove


def test_save_missing(dvc, mocker):
Expand Down Expand Up @@ -100,3 +102,20 @@ def test_get_used_objs(exists, expected_message, mocker, caplog):
with caplog.at_level(logging.WARNING, logger="dvc"):
assert {} == output.get_used_objs()
assert first(caplog.messages) == expected_message


def test_remote_missing_depenency_on_dir_pull(tmp_dir, scm, dvc, mocker):
tmp_dir.dvc_gen({"dir": {"subfile": "file2 content"}}, commit="add dir")
with dvc.config.edit() as conf:
conf["remote"]["s3"] = {"url": "s3://bucket/name"}
conf["core"] = {"remote": "s3"}

remove("dir")
remove(dvc.odb.local.cache_dir)

with mocker.patch(
"dvc.data_cloud.DataCloud.get_remote_odb",
side_effect=RemoteMissingDepsError("remote missing"),
):
with pytest.raises(RemoteMissingDepsError):
dvc.pull()