Skip to content

Commit

Permalink
storages: add repr (#493)
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry authored Dec 30, 2023
1 parent c7ad6f2 commit cc52981
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/dvc_data/index/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,13 @@ def __init__(
self.index = index
super().__init__(key, read_only=read_only)

def __repr__(self) -> str:
key = self.key
odb = self.odb
index = self.index
read_only = self.read_only
return f"{type(self).__name__}({key=!r}, {odb=!r}, {index=!r}, {read_only=!r})"

@property
def fs(self):
return self.odb.fs
Expand Down Expand Up @@ -245,6 +252,18 @@ def __init__(
self.prefix = prefix if prefix is not None else key
super().__init__(key, read_only=read_only)

def __repr__(self) -> str:
key = self.key
fs = self.fs
path = self.path
index = self.index
prefix = self.prefix
read_only = self.read_only
return (
f"{self.__class__.__name__}("
f"{key=!r}, {fs=!r}, {path=!r}, {index=!r}, {prefix=!r}, {read_only=!r})"
)

@property
def fs(self):
return self._fs
Expand Down

0 comments on commit cc52981

Please sign in to comment.