Skip to content

Commit bf33163

Browse files
committed
stringdtype test
1 parent 04871d4 commit bf33163

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pandas/tests/series/test_arrow_interface.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,19 @@ def test_series_arrow_interface_arrow_dtypes():
4343
ca = pa.chunked_array(s, type=pa.int32())
4444
expected = pa.chunked_array([[1, 4, 2]], type=pa.int32())
4545
assert ca.equals(expected)
46+
47+
48+
def test_series_arrow_interface_stringdtype():
49+
s = pd.Series(["foo", "bar"], dtype="string[pyarrow]")
50+
51+
capsule = s.__arrow_c_stream__()
52+
assert (
53+
ctypes.pythonapi.PyCapsule_IsValid(
54+
ctypes.py_object(capsule), b"arrow_array_stream"
55+
)
56+
== 1
57+
)
58+
59+
ca = pa.chunked_array(s)
60+
expected = pa.chunked_array([["foo", "bar"]], type=pa.large_string())
61+
assert ca.equals(expected)

0 commit comments

Comments
 (0)