Skip to content

Commit 72099f5

Browse files
fix: limit before adding new data
1 parent 9da4e9b commit 72099f5

3 files changed

Lines changed: 3 additions & 51 deletions

File tree

graphgen/models/vis/__init__.py

Whitespace-only changes.

graphgen/models/vis/community_visualizer.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

graphgen/operators/read/read.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,16 @@ def read(
121121
else:
122122
combined_ds = read_tasks[0].union(*read_tasks[1:])
123123

124+
if read_nums is not None:
125+
combined_ds = combined_ds.limit(read_nums)
126+
124127
combined_ds = combined_ds.map(
125128
lambda record: {
126129
**record,
127130
"_trace_id": compute_mm_hash(record, prefix="doc-"),
128131
}
129132
)
130133

131-
if read_nums is not None:
132-
combined_ds = combined_ds.limit(read_nums)
133-
134134
# sample record
135135
for i, item in enumerate(combined_ds.take(1)):
136136
logger.debug("[READ] Sample record %d: %s", i, item)

0 commit comments

Comments
 (0)