Debian Codegraph @

dask/conftest.py

raw
1 from __future__ import annotations
2
3 import pytest
4
5 try:
6 from dask.dataframe.utils import pyarrow_strings_enabled
7
8 convert_string = pyarrow_strings_enabled()
9 except (ImportError, RuntimeError):
10 convert_string = False
11
12 skip_with_pyarrow_strings = pytest.mark.skipif(
13 convert_string,
14 reason="No need to run with pyarrow strings",
15 )
16
17 xfail_with_pyarrow_strings = pytest.mark.xfail(
18 convert_string,
19 reason="Known failure with pyarrow strings",
20 )
21
22
23 def pytest_collection_modifyitems(config, items):
24 for item in items:
25 if "skip_with_pyarrow_strings" in item.keywords:
26 item.add_marker(skip_with_pyarrow_strings)
27 if "xfail_with_pyarrow_strings" in item.keywords:
28 item.add_marker(xfail_with_pyarrow_strings)
29
30
31 @pytest.fixture(params=["disk", "tasks"])
32 def shuffle_method(request):
33 import dask
34
35 with dask.config.set({"dataframe.shuffle.method": request.param}):
36 yield request.param