@@ -204,7 +204,7 @@ def test_from_sequence_with_arrow_array_and_dtype():
204
204
type = pa_type ,
205
205
)
206
206
207
- actual = NestedExtensionArray .from_sequence (pa_array , dtype = new_pa_type )._chunked_array
207
+ actual = NestedExtensionArray .from_sequence (pa_array , dtype = new_pa_type ).chunked_array
208
208
desired = pa .chunked_array ([pa_array .cast (new_pa_type )])
209
209
# pyarrow doesn't convert pandas boxed missing values to nulls in nested arrays
210
210
assert actual == desired
@@ -525,7 +525,7 @@ def test___setitem___series_of_dfs():
525
525
)
526
526
desired = NestedExtensionArray (desired_struct_array )
527
527
528
- assert ext_array ._chunked_array == desired ._chunked_array
528
+ assert ext_array .chunked_array == desired .chunked_array
529
529
assert ext_array .equals (desired )
530
530
531
531
@@ -588,6 +588,21 @@ def test_series_built_raises(data):
588
588
_array = NestedExtensionArray (pa_array )
589
589
590
590
591
+ def test_chunked_array ():
592
+ """Test that the .chunked_array property is correct."""
593
+ struct_array = pa .StructArray .from_arrays (
594
+ arrays = [
595
+ pa .array ([np .array ([1 , 2 , 3 ]), np .array ([1 , 2 , 1 ])]),
596
+ pa .array ([- np .array ([4.0 , 5.0 , 6.0 ]), - np .array ([3.0 , 4.0 , 5.0 ])]),
597
+ ],
598
+ names = ["a" , "b" ],
599
+ )
600
+ ext_array = NestedExtensionArray (struct_array )
601
+
602
+ # pyarrow returns a single bool for ==
603
+ assert ext_array .chunked_array == pa .chunked_array (struct_array )
604
+
605
+
591
606
def test_list_offsets_single_chunk ():
592
607
"""Test that the .list_offset property is correct for a single chunk."""
593
608
struct_array = pa .StructArray .from_arrays (
0 commit comments