output: suppress cloud.pull errors on cache collection

Fixes https://github.com/iterative/studio/issues/5261
This commit is contained in:
Ruslan Kuprieiev
2023-03-09 22:44:32 +02:00
parent 1cfdc22549
commit 3aa9f51e36
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -2,6 +2,7 @@ import logging
import os
import posixpath
from collections import defaultdict
from contextlib import suppress
from operator import itemgetter
from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple, Type
from urllib.parse import urlparse
@@ -1017,7 +1018,8 @@ class Output:
except FileNotFoundError:
if self.remote:
kwargs["remote"] = self.remote
self.repo.cloud.pull([obj.hash_info], **kwargs)
with suppress(Exception):
self.repo.cloud.pull([obj.hash_info], **kwargs)
if self.obj:
return self.obj
+1 -1
View File
@@ -116,7 +116,7 @@ def test_remote_missing_dependency_on_dir_pull(tmp_dir, scm, dvc, mocker):
remove(dvc.cache.local.path)
mocker.patch(
"dvc.data_cloud.DataCloud.get_remote_odb",
"dvc.data_cloud.DataCloud.get_remote",
side_effect=RemoteMissingDepsError(dvc.fs, "azure", "azure://", []),
)
with pytest.raises(RemoteMissingDepsError):