From e4ae9cd94c7ca930593887bc5d0e869175e919e9 Mon Sep 17 00:00:00 2001 From: Quentin Lhoest Date: Fri, 14 Oct 2022 16:02:10 +0200 Subject: [PATCH] add error message for old versions of pyarrow --- src/datasets/table.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/datasets/table.py b/src/datasets/table.py index 4939eafbab4..376e1e960f5 100644 --- a/src/datasets/table.py +++ b/src/datasets/table.py @@ -2158,6 +2158,8 @@ def table_iter(pa_table: pa.Table, batch_size: int, drop_last_batch=False): batch_size (:obj:`int`): size of each sub-table to yield drop_last_batch (:obj:`bool`, default `False`): Drop the last batch if it is smaller than `batch_size` """ + if config.PYARROW_VERSION.major < 8: + raise RuntimeError(f"pyarrow>=8.0.0 is needed to use table_iter but you have {config.PYARROW_VERSION}") chunks_buffer = [] chunks_buffer_size = 0 for chunk in pa_table.to_reader(max_chunksize=batch_size):