Skip to content

Commit

Permalink
Don't .data on numpy array (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
martindurant authored Nov 20, 2023
1 parent 282c2de commit 296d7ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fastparquet/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ def read_data_page(f, helper, header, metadata, skip_nulls=False,
o = encoding.NumpyIO(values)
encoding.read_rle_bit_packed_hybrid(
io_obj, bit_width, io_obj.len-io_obj.tell(), o=o, itemsize=1)
values = values.data[:nval]
if isinstance(values, np.ndarray):
values = values[:nval]
else:
values = values.data[:nval]
else:
values = np.zeros(nval, dtype=np.int8)
elif daph.encoding == parquet_thrift.Encoding.DELTA_BINARY_PACKED:
Expand Down

0 comments on commit 296d7ba

Please sign in to comment.