Skip to content

Commit

Permalink
use generator
Browse files Browse the repository at this point in the history
Co-authored-by: Quentin Lhoest <42851186+lhoestq@users.noreply.github.com>
  • Loading branch information
kmehant and lhoestq committed Jul 17, 2024
1 parent cfc730c commit c257792
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datasets/packaged_modules/arrow/arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def _generate_tables(self, files):
batches = pa.ipc.open_stream(f)
except pa.lib.ArrowInvalid:
reader = pa.ipc.open_file(f)
batches = [reader.get_batch(i) for i in range(reader.num_record_batches)]
batches = (reader.get_batch(i) for i in range(reader.num_record_batches))
for batch_idx, record_batch in enumerate(batches):
pa_table = pa.Table.from_batches([record_batch])
# Uncomment for debugging (will print the Arrow table size and elements)
Expand Down

0 comments on commit c257792

Please sign in to comment.