From cd9dd0a312f41c5e05894fd95ba1bea2d9ddca45 Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Mon, 20 Feb 2023 17:32:11 +0200 Subject: [PATCH] index: use has_node instead of ls Current code doesn't work for prefixes longer than one, which makes index cache effectively not work and it should've used has_node from the very start anyway. --- dvc/repo/index.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dvc/repo/index.py b/dvc/repo/index.py index 38fddea8b..217b2278e 100644 --- a/dvc/repo/index.py +++ b/dvc/repo/index.py @@ -364,7 +364,7 @@ class Index: index = DataIndex() prefix = ("tree", self.data_tree.hash_info.value) - if prefix in index.ls((), detail=False): + if index.has_node(prefix): loaded = True try: diff --git a/pyproject.toml b/pyproject.toml index a719bc35f..8874273d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ dependencies = [ "configobj>=5.0.6", "distro>=1.3", "dpath<3,>=2.0.2", - "dvc-data>=0.41.0,<0.42", + "dvc-data>=0.41.1,<0.42", "dvc-http", "dvc-render>=0.1.2", "dvc-studio-client>=0.1.1",