milesgranger commented on code in PR #13894: URL: https://github.com/apache/arrow/pull/13894#discussion_r959137809
########## python/pyarrow/tests/test_array.py: ########## @@ -919,6 +919,53 @@ def test_list_from_arrays(list_array_type, list_type_factory): list_array_type.from_arrays(offsets, values, type=typ) +@pytest.mark.parametrize(('list_array_type', 'list_type_factory'), ( + (pa.ListArray, pa.list_), + (pa.LargeListArray, pa.large_list) +)) +@pytest.mark.parametrize("arr", ( + [None, [0]], + [None, [0, None], [0]], + [[0], [1]], +)) +def test_list_array_types_from_arrays( + list_array_type, list_type_factory, arr +): + arr = pa.array(arr, list_type_factory(pa.int8())) + reconstructed_arr = list_array_type.from_arrays( + arr.offsets, arr.values, mask=arr.is_null()) + assert arr == reconstructed_arr Review Comment: After more discussion with @jorisvandenbossche it appears it wouldn't be possible after all. So in https://github.com/apache/arrow/pull/13894/commits/b04f2327306fd5365e6de2aa7dbe72e28a074aa0 I've simply caught and raised an error on this case. -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org