Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cpp/src/arrow/array/builder_binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,10 @@ class ARROW_EXPORT FixedSizeBinaryBuilder : public ArrayBuilder {
}
}

void UnsafeAppend(const char* value) {
UnsafeAppend(reinterpret_cast<const uint8_t*>(value));
}

void UnsafeAppend(util::string_view value) {
#ifndef NDEBUG
CheckValueSize(static_cast<size_t>(value.size()));
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/arrow/python/python_to_arrow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,7 @@ Result<std::shared_ptr<ChunkedArray>> ConvertPySequence(PyObject* obj, PyObject*
return chunked_converter->ToChunkedArray();
} else {
// If the converter can't overflow spare the capacity error checking on the hot-path,
// this improves the performance roughly by ~10 for primitive types.
// this improves the performance roughly by ~10% for primitive types.
if (mask != nullptr && mask != Py_None) {
RETURN_NOT_OK(ExtendMasked(converter.get(), seq, mask, size));
} else {
Expand Down
9 changes: 9 additions & 0 deletions python/pyarrow/tests/test_convert_builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,15 @@ def test_fixed_size_bytes_does_not_accept_varying_lengths():
pa.array(data, type=pa.binary(4))


def test_fixed_size_binary_length_check():
# ARROW-10193
data = [b'\x19h\r\x9e\x00\x00\x00\x00\x01\x9b\x9fA']
assert len(data[0]) == 12
ty = pa.binary(12)
arr = pa.array(data, type=ty)
assert arr.to_pylist() == data


def test_sequence_date():
data = [datetime.date(2000, 1, 1), None, datetime.date(1970, 1, 1),
datetime.date(2040, 2, 26)]
Expand Down