Skip to content

Commit

Permalink
Fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
garlontas committed Jul 31, 2023
1 parent bd92446 commit 4446271
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions pystreamapi/loaders/__csv_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ def csv(file_path: str, delimiter=',', encoding="utf-8") -> LazyFileIterable:
:param delimiter: The delimiter used in the CSV file.
"""
file_path = __validate_path(file_path)
loader = lambda: __load_csv(file_path, delimiter, encoding)

return LazyFileIterable(loader)
return LazyFileIterable(lambda: __load_csv(file_path, delimiter, encoding))


def __load_csv(file_path, delimiter, encoding):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ def test_csv_loader_with_invalid_path(self):
with self.assertRaises(FileNotFoundError):
csv(f'{self.path}/invalid.csv')

def test_csv_loader_with_non_absolute_path(self):
def test_csv_loader_with_non_file(self):
with self.assertRaises(ValueError):
csv('invalid.csv')
csv(f'{self.path}/')

0 comments on commit 4446271

Please sign in to comment.