Skip to content

Commit 247eca5

Browse files
committed
Add pyarrow integration test
1 parent ff3dc75 commit 247eca5

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

arrow-data/src/data.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,16 @@ impl ArrayData {
620620
vec![ArrayData::new_null(f.data_type(), *list_len as usize * len)],
621621
true,
622622
),
623+
DataType::ListView(f) => (
624+
vec![zeroed(len * 4), zeroed(len * 4)],
625+
vec![ArrayData::new_empty(f.data_type())],
626+
true,
627+
),
628+
DataType::LargeListView(f) => (
629+
vec![zeroed(len * 8), zeroed(len * 8)],
630+
vec![ArrayData::new_empty(f.data_type())],
631+
true,
632+
),
623633
DataType::Struct(fields) => (
624634
vec![],
625635
fields

arrow-pyarrow-integration-testing/tests/test_sql.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ def assert_pyarrow_leak():
7474
pa.list_(pa.int32()),
7575
pa.list_(pa.int32(), 2),
7676
pa.large_list(pa.uint16()),
77+
pa.list_view(pa.uint64()),
78+
pa.large_list_view(pa.uint64()),
79+
pa.list_view(pa.string()),
80+
pa.large_list_view(pa.string()),
7781
pa.struct(
7882
[
7983
pa.field("a", pa.int32()),
@@ -112,8 +116,6 @@ def assert_pyarrow_leak():
112116
),
113117
]
114118

115-
_unsupported_pyarrow_types = [
116-
]
117119

118120
# As of pyarrow 14, pyarrow implements the Arrow PyCapsule interface
119121
# (https://arrow.apache.org/docs/format/CDataInterface/PyCapsuleInterface.html).
@@ -337,6 +339,20 @@ def test_list_array():
337339
del a
338340
del b
339341

342+
343+
def test_list_view_array():
344+
"""
345+
Python -> Rust -> Python
346+
"""
347+
a = pa.array([[], None, [1, 2], [4, 5, 6]], pa.list_view(pa.int64()))
348+
b = rust.round_trip_array(a)
349+
b.validate(full=True)
350+
assert a.to_pylist() == b.to_pylist()
351+
assert a.type == b.type
352+
del a
353+
del b
354+
355+
340356
def test_map_array():
341357
"""
342358
Python -> Rust -> Python

0 commit comments

Comments
 (0)