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
10 changes: 10 additions & 0 deletions src/dvc_data/index/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from functools import partial
from typing import TYPE_CHECKING, Optional, Set

from dvc_objects.fs.local import LocalFileSystem
from fsspec.callbacks import DEFAULT_CALLBACK

from dvc_data.callbacks import TqdmCallback
Expand Down Expand Up @@ -77,6 +78,15 @@ def _filter_changed(index):
meta = Meta.from_info(info)
old = getattr(entry.meta, data_fs.PARAM_CHECKSUM, None) if entry.meta else None
new = getattr(meta, data_fs.PARAM_CHECKSUM, None)

if old and new is None and isinstance(data_fs, LocalFileSystem):
# NOTE: temporary ugly hack to handle local sources where
# the only thing we currently have is md5.
from dvc_data.hashfile.hash import hash_file

_, hi = hash_file(data_path, data_fs, "md5")
new = hi.value

if old and new and old == new:
ret.add(entry)

Expand Down