Skip to content

Commit b5d026e

Browse files
feat: add param read_nums
1 parent 56fd51d commit b5d026e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

graphgen/operators/read/read.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def read(
5353
working_dir: Optional[str] = "cache",
5454
parallelism: int = 4,
5555
recursive: bool = True,
56+
read_num: Optional[int] = None,
5657
**reader_kwargs: Any,
5758
) -> ray.data.Dataset:
5859
"""
@@ -120,6 +121,9 @@ def read(
120121
}
121122
)
122123

124+
if read_num is not None:
125+
combined_ds = combined_ds.limit(read_num)
126+
123127
logger.info("[READ] Successfully read files from %s", input_path)
124128
return combined_ds
125129

0 commit comments

Comments
 (0)