Skip to content

Commit 8427b3f

Browse files
committed
moving some lines around
1 parent 9167ca3 commit 8427b3f

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/valor_lite/cache.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,18 @@ def __init__(
120120
self._rows_per_file = rows_per_file
121121
self._compression = compression
122122

123+
@classmethod
124+
def load(cls, path: str | Path):
125+
path = Path(path)
126+
123127
# validate path
124-
if not self._path.exists():
125-
raise FileNotFoundError(f"Directory does not exist: {self._path}")
126-
elif not self._path.is_dir():
128+
if not path.exists():
129+
raise FileNotFoundError(f"Directory does not exist: {path}")
130+
elif not path.is_dir():
127131
raise NotADirectoryError(
128-
f"Path exists but is not a directory: {self._path}"
132+
f"Path exists but is not a directory: {path}"
129133
)
130134

131-
@classmethod
132-
def load(cls, path: str | Path):
133135
def _retrieve(config: dict, key: str):
134136
if value := config.get(key, None):
135137
return value

0 commit comments

Comments
 (0)