2323 "ignore:Passing a BlockManager to DataFrame:DeprecationWarning"
2424)
2525
26- xfail_pyarrow = pytest .mark .usefixtures ("pyarrow_xfail" )
2726skip_pyarrow = pytest .mark .usefixtures ("pyarrow_skip" )
2827
2928
@@ -238,7 +237,6 @@ def test_parse_encoded_special_characters(encoding):
238237 tm .assert_frame_equal (result , expected )
239238
240239
241- @xfail_pyarrow # ValueError: The 'memory_map' option is not supported
242240@pytest .mark .parametrize ("encoding" , ["utf-8" , None , "utf-16" , "cp1255" , "latin-1" ])
243241def test_encoding_memory_map (all_parsers , encoding ):
244242 # GH40986
@@ -252,11 +250,17 @@ def test_encoding_memory_map(all_parsers, encoding):
252250 )
253251 with tm .ensure_clean () as file :
254252 expected .to_csv (file , index = False , encoding = encoding )
253+
254+ if parser .engine == "pyarrow" :
255+ msg = "The 'memory_map' option is not supported with the 'pyarrow' engine"
256+ with pytest .raises (ValueError , match = msg ):
257+ parser .read_csv (file , encoding = encoding , memory_map = True )
258+ return
259+
255260 df = parser .read_csv (file , encoding = encoding , memory_map = True )
256261 tm .assert_frame_equal (df , expected )
257262
258263
259- @xfail_pyarrow # ValueError: The 'memory_map' option is not supported
260264def test_chunk_splits_multibyte_char (all_parsers ):
261265 """
262266 Chunk splits a multibyte character with memory_map=True
@@ -272,11 +276,17 @@ def test_chunk_splits_multibyte_char(all_parsers):
272276 df .iloc [2047 ] = "a" * 127 + "ą"
273277 with tm .ensure_clean ("bug-gh43540.csv" ) as fname :
274278 df .to_csv (fname , index = False , header = False , encoding = "utf-8" )
275- dfr = parser .read_csv (fname , header = None , memory_map = True , engine = "c" )
279+
280+ if parser .engine == "pyarrow" :
281+ msg = "The 'memory_map' option is not supported with the 'pyarrow' engine"
282+ with pytest .raises (ValueError , match = msg ):
283+ parser .read_csv (fname , header = None , memory_map = True )
284+ return
285+
286+ dfr = parser .read_csv (fname , header = None , memory_map = True )
276287 tm .assert_frame_equal (dfr , df )
277288
278289
279- @xfail_pyarrow # ValueError: The 'memory_map' option is not supported
280290def test_readcsv_memmap_utf8 (all_parsers ):
281291 """
282292 GH 43787
@@ -300,9 +310,14 @@ def test_readcsv_memmap_utf8(all_parsers):
300310 df = DataFrame (lines )
301311 with tm .ensure_clean ("utf8test.csv" ) as fname :
302312 df .to_csv (fname , index = False , header = False , encoding = "utf-8" )
303- dfr = parser .read_csv (
304- fname , header = None , memory_map = True , engine = "c" , encoding = "utf-8"
305- )
313+
314+ if parser .engine == "pyarrow" :
315+ msg = "The 'memory_map' option is not supported with the 'pyarrow' engine"
316+ with pytest .raises (ValueError , match = msg ):
317+ parser .read_csv (fname , header = None , memory_map = True , encoding = "utf-8" )
318+ return
319+
320+ dfr = parser .read_csv (fname , header = None , memory_map = True , encoding = "utf-8" )
306321 tm .assert_frame_equal (df , dfr )
307322
308323
0 commit comments