Skip to content

Commit 36916ea

Browse files
authored
db: add misc type annotations
1 parent b889cd7 commit 36916ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/dvc_objects/db.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __eq__(self, other):
4343
def __hash__(self):
4444
return hash((self.fs.protocol, self.path))
4545

46-
def exists(self, oid: str):
46+
def exists(self, oid: str) -> bool:
4747
return self.fs.exists(self.oid_to_path(oid))
4848

4949
def move(self, from_info, to_info):
@@ -52,7 +52,7 @@ def move(self, from_info, to_info):
5252
def makedirs(self, path):
5353
self.fs.makedirs(path)
5454

55-
def get(self, oid: str):
55+
def get(self, oid: str) -> Object:
5656
return Object(
5757
self.oid_to_path(oid),
5858
self.fs,
@@ -93,7 +93,7 @@ def add(
9393
callback=Callback.as_callback(cb),
9494
)
9595

96-
def oid_to_path(self, oid):
96+
def oid_to_path(self, oid) -> str:
9797
return self.fs.path.join(self.path, oid[0:2], oid[2:])
9898

9999
def _list_paths(self, prefix: str = None):
@@ -105,7 +105,7 @@ def _list_paths(self, prefix: str = None):
105105
parts = *parts, prefix[2:]
106106
yield from self.fs.find(self.fs.path.join(*parts), prefix=bool(prefix))
107107

108-
def path_to_oid(self, path):
108+
def path_to_oid(self, path) -> str:
109109
parts = self.fs.path.parts(path)[-2:]
110110

111111
if not (len(parts) == 2 and parts[0] and len(parts[0]) == 2):

0 commit comments

Comments
 (0)