@@ -1854,6 +1854,15 @@ def test_table_str_to_categorical_without_na(self, string_type):
1854
1854
table .to_pandas (strings_to_categorical = True ,
1855
1855
zero_copy_only = True )
1856
1856
1857
+ # chunked array
1858
+ result = table ["strings" ].to_pandas (strings_to_categorical = True )
1859
+ expected = pd .Series (pd .Categorical (values ), name = "strings" )
1860
+ tm .assert_series_equal (result , expected )
1861
+
1862
+ with pytest .raises (pa .ArrowInvalid ):
1863
+ table ["strings" ].to_pandas (strings_to_categorical = True ,
1864
+ zero_copy_only = True )
1865
+
1857
1866
@pytest .mark .parametrize (
1858
1867
"string_type" , [pa .string (), pa .large_string (), pa .string_view ()]
1859
1868
)
@@ -1872,6 +1881,15 @@ def test_table_str_to_categorical_with_na(self, string_type):
1872
1881
table .to_pandas (strings_to_categorical = True ,
1873
1882
zero_copy_only = True )
1874
1883
1884
+ # chunked array
1885
+ result = table ["strings" ].to_pandas (strings_to_categorical = True )
1886
+ expected = pd .Series (pd .Categorical (values ), name = "strings" )
1887
+ tm .assert_series_equal (result , expected )
1888
+
1889
+ with pytest .raises (pa .ArrowInvalid ):
1890
+ table ["strings" ].to_pandas (strings_to_categorical = True ,
1891
+ zero_copy_only = True )
1892
+
1875
1893
# Regression test for ARROW-2101
1876
1894
def test_array_of_bytes_to_strings (self ):
1877
1895
converted = pa .array (np .array ([b'x' ], dtype = object ), pa .string ())
0 commit comments