Skip to content

Commit 298e343

Browse files
pcmoritzwesm
authored andcommitted
ARROW-1673: [Python] Add support for numpy 'bool' type
This is currently a workaround until the Arrow tensor supports zero copy of byte-length booleans. Author: Philipp Moritz <pcmoritz@gmail.com> Closes apache#1199 from pcmoritz/ndarray-bool and squashes the following commits: 14943a0 [Philipp Moritz] deploy workaround 8fce724 [Philipp Moritz] update ad4c6b9 [Philipp Moritz] change bool width to 1 byte 11c7ed3 [Philipp Moritz] add support for numpy 'bool' type
1 parent a4813bd commit 298e343

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

‎cpp/src/arrow/python/python_to_arrow.cc‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,6 @@ Status SerializeArray(PyObject* context, PyArrayObject* array, SequenceBuilder*
528528
std::vector<PyObject*>* tensors_out) {
529529
int dtype = PyArray_TYPE(array);
530530
switch (dtype) {
531-
case NPY_BOOL:
532531
case NPY_UINT8:
533532
case NPY_INT8:
534533
case NPY_UINT16:

‎python/pyarrow/tests/test_serialization.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def test_default_dict_serialization(large_memory_map):
257257

258258
def test_numpy_serialization(large_memory_map):
259259
with pa.memory_map(large_memory_map, mode="r+") as mmap:
260-
for t in ["int8", "uint8", "int16", "uint16", "int32", "uint32",
260+
for t in ["bool", "int8", "uint8", "int16", "uint16", "int32", "uint32",
261261
"float16", "float32", "float64"]:
262262
obj = np.random.randint(0, 10, size=(100, 100)).astype(t)
263263
serialization_roundtrip(obj, mmap)

0 commit comments

Comments
 (0)