From 134c0f451423823ae190f5cf88a0fff2df867e3e Mon Sep 17 00:00:00 2001 From: Ruslan Kuprieiev Date: Thu, 28 Sep 2023 04:26:51 +0300 Subject: [PATCH] index: introduce DataIndexEntry.isdir --- src/dvc_data/index/index.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dvc_data/index/index.py b/src/dvc_data/index/index.py index 564067fc..8abb3ba9 100644 --- a/src/dvc_data/index/index.py +++ b/src/dvc_data/index/index.py @@ -43,6 +43,13 @@ class DataIndexEntry: loaded: Optional[bool] = None + @property + def isdir(self) -> bool: + if self.meta: + return self.meta.isdir + + return False + @classmethod def from_dict(cls, d: Dict[str, Dict]) -> "DataIndexEntry": ret = cls()