File tree 1 file changed +14
-7
lines changed
1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change 12
12
)
13
13
import pandas ._testing as tm
14
14
15
+ from pandas .io .parsers import readers
16
+ from pandas .io .parsers .arrow_parser_wrapper import ArrowParserWrapper
17
+
15
18
16
19
class BaseParser :
17
20
engine : str | None = None
@@ -101,20 +104,24 @@ def csv1(datapath):
101
104
102
105
103
106
@pytest .fixture (params = _all_parsers , ids = _all_parser_ids )
104
- def all_parsers (request ):
107
+ def all_parsers (request , monkeypatch ):
105
108
"""
106
109
Fixture all of the CSV parsers.
107
110
"""
108
111
parser = request .param ()
109
112
if parser .engine == "pyarrow" :
110
113
pytest .importorskip ("pyarrow" , VERSIONS ["pyarrow" ])
111
- # Try setting num cpus to 1 to avoid hangs on Azure MacOS/Windows builds
112
- # or better yet find a way to disable threads
113
- # TODO(GH#44584) pytest.mark.single these tests
114
- import pyarrow
115
114
116
- pyarrow .set_cpu_count (1 )
117
- return parser
115
+ class NoThreadArrowParserWrapper (ArrowParserWrapper ):
116
+ def _get_pyarrow_options (self ):
117
+ super ()._get_pyarrow_options ()
118
+ self .read_options ["use_threads" ] = False
119
+
120
+ with monkeypatch .context () as m :
121
+ m .setattr (readers , "ArrowParserWrapper" , NoThreadArrowParserWrapper )
122
+ yield parser
123
+ else :
124
+ yield parser
118
125
119
126
120
127
@pytest .fixture (params = _c_parsers_only , ids = _c_parser_ids )
You can’t perform that action at this time.
0 commit comments