From 93c556acdd5de279baefff5a2d246f680e21128b Mon Sep 17 00:00:00 2001 From: Peter Rowlands Date: Wed, 8 Feb 2023 14:49:50 +0900 Subject: [PATCH] index: fix index entries for partial import stages --- dvc/output.py | 2 ++ dvc/repo/index.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dvc/output.py b/dvc/output.py index da31f1d882..a38af325b3 100644 --- a/dvc/output.py +++ b/dvc/output.py @@ -577,6 +577,8 @@ def get_entry(self) -> "DataIndexEntry": if not dep.obj and dep.files: dep.obj = dep.get_obj() entry.obj = dep.obj + if not entry.hash_info and dep.obj: + entry.hash_info = dep.obj.hash_info return entry def changed_checksum(self): diff --git a/dvc/repo/index.py b/dvc/repo/index.py index a03171bc37..1374e0a682 100644 --- a/dvc/repo/index.py +++ b/dvc/repo/index.py @@ -466,7 +466,7 @@ def _data_prefixes(self) -> Dict[str, "_DataPrefixes"]: workspace, key = out.index_key if filter_info and out.fs.path.isin(filter_info, out.fs_path): key = key + out.fs.path.relparts(filter_info, out.fs_path) - if out.meta.isdir: + if out.meta.isdir or out.stage.is_import and out.stage.deps[0].meta.isdir: prefixes[workspace].recursive.add(key) prefixes[workspace].explicit.update(key[:i] for i in range(len(key), 0, -1)) return prefixes