@@ -155,7 +155,7 @@ def primitive_column_to_ndarray(col: Column) -> tuple[np.ndarray, Any]:
155
155
buffers = col .get_buffers ()
156
156
157
157
data_buff , data_dtype = buffers ["data" ]
158
- data = buffer_to_ndarray (data_buff , data_dtype , col .offset , col .size )
158
+ data = buffer_to_ndarray (data_buff , data_dtype , col .offset , col .size () )
159
159
160
160
data = set_nulls (data , col , buffers ["validity" ])
161
161
return data , buffers
@@ -187,7 +187,7 @@ def categorical_column_to_series(col: Column) -> tuple[pd.Series, Any]:
187
187
buffers = col .get_buffers ()
188
188
189
189
codes_buff , codes_dtype = buffers ["data" ]
190
- codes = buffer_to_ndarray (codes_buff , codes_dtype , col .offset , col .size )
190
+ codes = buffer_to_ndarray (codes_buff , codes_dtype , col .offset , col .size () )
191
191
192
192
# Doing module in order to not get ``IndexError`` for
193
193
# out-of-bounds sentinel values in `codes`
@@ -244,29 +244,29 @@ def string_column_to_ndarray(col: Column) -> tuple[np.ndarray, Any]:
244
244
Endianness .NATIVE ,
245
245
)
246
246
# Specify zero offset as we don't want to chunk the string data
247
- data = buffer_to_ndarray (data_buff , data_dtype , offset = 0 , length = col .size )
247
+ data = buffer_to_ndarray (data_buff , data_dtype , offset = 0 , length = col .size () )
248
248
249
249
# Retrieve the offsets buffer containing the index offsets demarcating
250
250
# the beginning and the ending of each string
251
251
offset_buff , offset_dtype = buffers ["offsets" ]
252
252
# Offsets buffer contains start-stop positions of strings in the data buffer,
253
- # meaning that it has more elements than in the data buffer, do `col.size + 1` here
254
- # to pass a proper offsets buffer size
253
+ # meaning that it has more elements than in the data buffer, do `col.size() + 1`
254
+ # here to pass a proper offsets buffer size
255
255
offsets = buffer_to_ndarray (
256
- offset_buff , offset_dtype , col .offset , length = col .size + 1
256
+ offset_buff , offset_dtype , col .offset , length = col .size () + 1
257
257
)
258
258
259
259
null_pos = None
260
260
if null_kind in (ColumnNullType .USE_BITMASK , ColumnNullType .USE_BYTEMASK ):
261
261
assert buffers ["validity" ], "Validity buffers cannot be empty for masks"
262
262
valid_buff , valid_dtype = buffers ["validity" ]
263
- null_pos = buffer_to_ndarray (valid_buff , valid_dtype , col .offset , col .size )
263
+ null_pos = buffer_to_ndarray (valid_buff , valid_dtype , col .offset , col .size () )
264
264
if sentinel_val == 0 :
265
265
null_pos = ~ null_pos
266
266
267
267
# Assemble the strings from the code units
268
- str_list : list [None | float | str ] = [None ] * col .size
269
- for i in range (col .size ):
268
+ str_list : list [None | float | str ] = [None ] * col .size ()
269
+ for i in range (col .size () ):
270
270
# Check for missing values
271
271
if null_pos is not None and null_pos [i ]:
272
272
str_list [i ] = np .nan
@@ -349,7 +349,7 @@ def datetime_column_to_ndarray(col: Column) -> tuple[np.ndarray, Any]:
349
349
Endianness .NATIVE ,
350
350
),
351
351
col .offset ,
352
- col .size ,
352
+ col .size () ,
353
353
)
354
354
355
355
data = parse_datetime_format_str (format_str , data )
@@ -501,7 +501,7 @@ def set_nulls(
501
501
elif null_kind in (ColumnNullType .USE_BITMASK , ColumnNullType .USE_BYTEMASK ):
502
502
assert validity , "Expected to have a validity buffer for the mask"
503
503
valid_buff , valid_dtype = validity
504
- null_pos = buffer_to_ndarray (valid_buff , valid_dtype , col .offset , col .size )
504
+ null_pos = buffer_to_ndarray (valid_buff , valid_dtype , col .offset , col .size () )
505
505
if sentinel_val == 0 :
506
506
null_pos = ~ null_pos
507
507
elif null_kind in (ColumnNullType .NON_NULLABLE , ColumnNullType .USE_NAN ):
0 commit comments