@@ -169,7 +169,7 @@ def _arrowtable2df(
169169 path : str ,
170170 path_root : Optional [str ],
171171) -> pd .DataFrame :
172- return _apply_partitions (
172+ df : pd . DataFrame = _apply_partitions (
173173 df = table .to_pandas (
174174 use_threads = use_threads ,
175175 split_blocks = True ,
@@ -185,6 +185,7 @@ def _arrowtable2df(
185185 path = path ,
186186 path_root = path_root ,
187187 )
188+ return _utils .ensure_df_is_mutable (df = df )
188189
189190
190191def _read_parquet_chunked (
@@ -254,7 +255,7 @@ def _read_parquet_chunked(
254255 yield next_slice
255256
256257
257- def _read_parquet_file_single_thread (
258+ def _read_parquet_file (
258259 path : str ,
259260 columns : Optional [List [str ]],
260261 categories : Optional [List [str ]],
@@ -285,7 +286,7 @@ def _count_row_groups(
285286 return pq_file .num_row_groups
286287
287288
288- def _read_parquet_file_multi_thread (
289+ def _read_parquet_row_group (
289290 row_group : int ,
290291 path : str ,
291292 columns : Optional [List [str ]],
@@ -306,7 +307,7 @@ def _read_parquet_file_multi_thread(
306307 return pq_file .read_row_group (i = row_group , columns = columns , use_threads = False , use_pandas_metadata = False )
307308
308309
309- def _read_parquet_file (
310+ def _read_parquet (
310311 path : str ,
311312 columns : Optional [List [str ]],
312313 categories : Optional [List [str ]],
@@ -318,7 +319,7 @@ def _read_parquet_file(
318319 use_threads : bool ,
319320) -> pd .DataFrame :
320321 if use_threads is False :
321- table : pa .Table = _read_parquet_file_single_thread (
322+ table : pa .Table = _read_parquet_file (
322323 path = path ,
323324 columns = columns ,
324325 categories = categories ,
@@ -333,7 +334,7 @@ def _read_parquet_file(
333334 with concurrent .futures .ThreadPoolExecutor (max_workers = cpus ) as executor :
334335 tables : Tuple [pa .Table , ...] = tuple (
335336 executor .map (
336- _read_parquet_file_multi_thread ,
337+ _read_parquet_row_group ,
337338 range (num_row_groups ),
338339 itertools .repeat (path ),
339340 itertools .repeat (columns ),
@@ -529,7 +530,7 @@ def read_parquet(
529530 if chunked is not False :
530531 return _read_parquet_chunked (paths = paths , chunked = chunked , validate_schema = validate_schema , ** args )
531532 if len (paths ) == 1 :
532- return _read_parquet_file (path = paths [0 ], ** args )
533+ return _read_parquet (path = paths [0 ], ** args )
533534 if validate_schema is True :
534535 _validate_schemas_from_files (
535536 paths = paths ,
@@ -540,8 +541,8 @@ def read_parquet(
540541 )
541542 if use_threads is True :
542543 args ["use_threads" ] = True
543- return _read_concurrent (func = _read_parquet_file , ignore_index = True , paths = paths , ** args )
544- return _union (dfs = [_read_parquet_file (path = p , ** args ) for p in paths ], ignore_index = True )
544+ return _read_concurrent (func = _read_parquet , ignore_index = True , paths = paths , ** args )
545+ return _union (dfs = [_read_parquet (path = p , ** args ) for p in paths ], ignore_index = True )
545546
546547
547548@apply_configs
0 commit comments