Skip to content

CSV loader not lazy #62

@garlontas

Description

@garlontas

Describe the bug
The CSV loader isn't lazy. It reads the content from the CSV file directly at call.

To Reproduce

from pystreamapi import Stream
from pystreamapi.loaders import csv

stream = Stream.of(csv("/path/to/data.csv")) # CSV is already read here. This is time and memory consuming!
stream.filter(...).map(...).for_each(...) # The terminal operation should actually trigger the CSV reader.

Expected behavior
The CSV file should be only read when the iterable (return of csv() function) is accessed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions