Skip to content

Commit

Permalink
add check if data_dir exists
Browse files Browse the repository at this point in the history
  • Loading branch information
AstrakhantsevaAA committed Jul 5, 2023
1 parent 146d2d6 commit 5ca685e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sources/filesystem/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ def local_folder(
Yields:
TDataItem: A dictionary representing a file, containing the file path.
"""
if not Path(data_dir).is_dir():
if not Path(data_dir).exists():
raise ValueError(f"Local folder doesn't exist: {data_dir}")
else:
raise ValueError(f"Local folder is not a directory: {data_dir}")

if extensions:
files = (
p.resolve()
Expand Down

0 comments on commit 5ca685e

Please sign in to comment.