raulcd commented on issue #44651:
URL: https://github.com/apache/arrow/issues/44651#issuecomment-2470747271
Yes, if I remove the check:
```diff
diff --git a/python/pyarrow/array.pxi b/python/pyarrow/array.pxi
index eaedbf1e3..4ddbbea32 100644
--- a/python/pyarrow/array.pxi
+++ b/python/pyarrow/array.pxi
@@ -1174,10 +1174,10 @@ cdef class Array(_PandasConvertible):
"({0}) did not match the passed number "
"({1}).".format(type.num_fields,
len(children)))
- if type.num_buffers != len(buffers):
- raise ValueError("Type's expected number of buffers "
- "({0}) did not match the passed number "
- "({1}).".format(type.num_buffers,
len(buffers)))
+ #if type.num_buffers != len(buffers):
+ # raise ValueError("Type's expected number of buffers "
+ # "({0}) did not match the passed number "
+ # "({1}).".format(type.num_buffers,
len(buffers)))
for buf in buffers:
# None will produce a null buffer pointer
```
then it works as expected:
```
>>> import pyarrow as pa
>>> array1 = pa.array(['String longer than 12 characters', 'Short', None],
type=pa.string_view())
>>> new_array = pa.StringViewArray.from_buffers(pa.string_view(),
len(array1), array1.buffers())
>>> new_array
<pyarrow.lib.StringViewArray object at 0x739d58dc92a0>
[
"String longer than 12 characters",
"Short",
null
]
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]