Skip to content
Merged
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
12 changes: 9 additions & 3 deletions src/dvc_data/index/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@ def bulk_exists(
jobs: Optional[int] = None,
callback: "Callback" = DEFAULT_CALLBACK,
) -> dict["DataIndexEntry", bool]:
if not entries:
return {}

entries_with_hash = [e for e in entries if e.hash_info]
entries_without_hash = [e for e in entries if not e.hash_info]
results = dict.fromkeys(entries_without_hash, False)
callback.relative_update(len(entries_without_hash))

if not entries_with_hash:
return results

if self.index is None or not refresh:
for entry in callback.wrap(entries_with_hash):
assert entry.hash_info
Expand All @@ -270,6 +270,12 @@ def bulk_exists(
entry_map: dict[str, DataIndexEntry] = {
self.get(entry)[1]: entry for entry in entries_with_hash
}

try:
self.fs.ls(self.odb.path) # check for fs access
except FileNotFoundError:
pass

info_results = self.fs.info(
list(entry_map.keys()),
batch_size=jobs,
Expand Down
Loading