edits for feedback

This commit is contained in:
Joris Van den Bossche committed 2019-12-10 11:14:55 +01:00
1 parent 8d94b0f7a2
commit a502fa7292
2 files changed
+9 -8

No files matched your search

+2 -2
View File
@@ -504,8 +504,8 @@ Status FixedSizeListArray::FromArrays(const std::shared_ptr<Array>& values,
auto list_type = std::make_shared<FixedSizeListType>(values->type(), list_size);
std::shared_ptr<Buffer> validity_buf;
*out = std::make_shared<FixedSizeListArray>(list_type, length, values, validity_buf, -1,
0);
*out = std::make_shared<FixedSizeListArray>(list_type, length, values, validity_buf,
/*null_count=*/-1, /*offset=*/0);
return Status::OK();
}
+7 -6
View File
@@ -1444,18 +1444,19 @@ cdef class FixedSizeListArray(Array):
"""
@staticmethod
def from_arrays(values, int64_t length, MemoryPool pool=None):
def from_arrays(values, int64_t list_size, MemoryPool pool=None):
"""
Construct ListArray from arrays of int32 offsets and values
Construct FixedSizeListArray from array of values and a list length.
Parameters
----------
offsets : Array (int32 type)
values : Array (any type)
list_size : int
The fixed length of the lists.
Returns
-------
list_array : ListArray
FixedSizeListArray
"""
cdef:
Array _values
@@ -1465,7 +1466,7 @@ cdef class FixedSizeListArray(Array):
with nogil:
check_status(CFixedSizeListArray.FromArrays(
_values.sp_array, length, &out))
_values.sp_array, list_size, &out))
cdef Array result = pyarrow_wrap_array(out)
result.validate()
return result
@@ -1476,7 +1477,7 @@ cdef class FixedSizeListArray(Array):
def flatten(self):
"""
Unnest this ListArray by one level
Unnest this FixedSizeListArray by one level.
Returns
-------