From 9e590edb706e15ba99d1596d45dbf0d23a0474a1 Mon Sep 17 00:00:00 2001 From: Peter Rowlands Date: Tue, 4 Jan 2022 15:33:04 +0900 Subject: [PATCH] odb: pin index pickle protocol version --- dvc/objects/db/index.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dvc/objects/db/index.py b/dvc/objects/db/index.py index 4dc952a64..2b65f07b7 100644 --- a/dvc/objects/db/index.py +++ b/dvc/objects/db/index.py @@ -88,7 +88,7 @@ class ObjectDBIndex(ObjectDBIndexBase): tmp_dir: "StrPath", name: str, ): # pylint: disable=super-init-not-called - from diskcache import Index + from diskcache import Cache, Index from dvc.fs.local import LocalFileSystem from dvc.utils.fs import makedirs @@ -96,7 +96,13 @@ class ObjectDBIndex(ObjectDBIndexBase): self.index_dir = os.path.join(tmp_dir, self.INDEX_DIR, name) makedirs(self.index_dir, exist_ok=True) self.fs = LocalFileSystem() - self.index = Index(self.index_dir) + self.index = Index.fromcache( + Cache( + self.index_dir, + disk_pickle_protocol=4, + eviction_policy="none", + ) + ) def __iter__(self): return iter(self.index)