vyasr opened a new issue, #40319:
URL: https://github.com/apache/arrow/issues/40319
### Describe the bug, including details regarding any error messages,
version, and platform.
Currently pyarrow fails to construct an array from a null list scalar:
```
>>> import pyarrow as pa
>>> pa.__version__
'15.0.0'
>>> pa.array([pa.scalar(None, pa.list_(pa.int64()))])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "pyarrow/array.pxi", line 344, in pyarrow.lib.array
File "pyarrow/array.pxi", line 42, in pyarrow.lib._sequence_to_array
File "pyarrow/error.pxi", line 154, in
pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/types.pxi", line 88, in pyarrow.lib._datatype_to_pep3118
File "pyarrow/scalar.pxi", line 685, in pyarrow.lib.ListScalar.__len__
TypeError: object of type 'NoneType' has no len()
```
This may be worked around by directly constructing the array and specifying
the type when this case is detected:
```
>>> pa.array([None], type=pa.list_(pa.int64()))
<pyarrow.lib.ListArray object at 0x7f1d8e37f160>
[
null
]
```
### Component(s)
Python
--
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]