Skip to content

Commit

Permalink
added check for no fspaths being provided to a fileset
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Oct 16, 2024
1 parent 434f921 commit 10729bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fileformats/core/fileset.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def __init__(
metadata: ty.Optional[ty.Dict[str, ty.Any]] = None,
**load_kwargs: ty.Any,
):
if not fspaths:
raise ValueError("No file-system paths provided to FileSet")

Check warning on line 105 in fileformats/core/fileset.py

View check run for this annotation

Codecov / codecov/patch

fileformats/core/fileset.py#L105

Added line #L105 was not covered by tests
self._explicit_metadata = metadata
self._load_kwargs = load_kwargs
self._validate_class()
Expand Down Expand Up @@ -800,7 +802,7 @@ def byte_chunks(
rel_path: str
relative path to either 'relative_to' arg or common base path for each file
in the file set
byte_iter : Generator[bytes]
byte_iter : Generator[bytes, None, None]
an iterator over the bytes contents of the file, chunked into 'chunk_len'
chunks
"""
Expand Down

0 comments on commit 10729bd

Please sign in to comment.