Skip to content

Commit 445845d

Browse files
committed
minor
1 parent 5d3a6aa commit 445845d

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

pyiceberg/io/pyarrow.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,13 +1617,12 @@ def to_record_batches(self, tasks: Iterable[FileScanTask]) -> Iterator[pa.Record
16171617
):
16181618
for batch in batches:
16191619
current_batch_size = len(batch)
1620-
if self._limit is not None:
1621-
if total_row_count + current_batch_size >= self._limit:
1622-
yield batch.slice(0, self._limit - total_row_count)
1620+
if self._limit is not None and total_row_count + current_batch_size >= self._limit:
1621+
yield batch.slice(0, self._limit - total_row_count)
16231622

1624-
# This break will also cancel all tasks in the Pool
1625-
limit_reached = True
1626-
break
1623+
# This break will also cancel all running tasks
1624+
limit_reached = True
1625+
break
16271626

16281627
yield batch
16291628
total_row_count += current_batch_size

0 commit comments

Comments
 (0)