Skip to content

Commit 1e32dea

Browse files
committed
fix merge conflict
2 parents 2e982e2 + 39b0f01 commit 1e32dea

File tree

14 files changed

+635
-593
lines changed

14 files changed

+635
-593
lines changed

conda/environments/all_cuda-129_arch-aarch64.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ dependencies:
5959
- numpy>=1.23,<3.0a0
6060
- numpydoc
6161
- nvcomp==4.2.0.11
62+
- nvidia-ml-py
6263
- nvtx>=0.2.1
6364
- openpyxl
6465
- packaging

conda/environments/all_cuda-129_arch-x86_64.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ dependencies:
6060
- numpy>=1.23,<3.0a0
6161
- numpydoc
6262
- nvcomp==4.2.0.11
63+
- nvidia-ml-py
6364
- nvtx>=0.2.1
6465
- openpyxl
6566
- packaging

dependencies.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ dependencies:
718718
common:
719719
- output_types: [conda, requirements, pyproject]
720720
packages:
721+
- nvidia-ml-py
721722
- polars>=1.28,<1.32
722723
specific:
723724
- output_types: [requirements, pyproject]
@@ -729,8 +730,12 @@ dependencies:
729730
common:
730731
- output_types: [conda, requirements, pyproject]
731732
packages:
733+
<<<<<<< HEAD
732734
- rapids-dask-dependency==25.10.*,>=0.0.0a0
733735
- nvidia-ml-py
736+
=======
737+
- rapids-dask-dependency==25.8.*,>=0.0.0a0
738+
>>>>>>> branch-25.08
734739
run_dask_cudf:
735740
common:
736741
- output_types: [conda, requirements, pyproject]

python/cudf/cudf/tests/test_api_types.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,4 +1109,3 @@ def test_pandas_agreement_scalar(obj):
11091109

11101110

11111111
# TODO: Add test of interval.
1112-
# TODO: Add test of Scalar.

python/cudf/cudf/tests/test_array_function.py

Lines changed: 9 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2018-2024, NVIDIA CORPORATION.
1+
# Copyright (c) 2018-2025, NVIDIA CORPORATION.
22

33
import numpy as np
44
import pandas as pd
@@ -8,35 +8,11 @@
88
from cudf.testing import assert_eq
99

1010

11-
# To determine if NEP18 is available in the current version of NumPy we simply
12-
# attempt to concatenate an object with `__array_function__` defined and see if
13-
# NumPy invokes the protocol or not. Taken from dask array
14-
# https://github.com/dask/dask/blob/master/dask/array/utils.py#L352-L363
15-
# TODO: Unclear if this is still necessary. NEP 18 was introduced as the
16-
# default in 1.17 (https://github.com/numpy/numpy/releases/tag/v1.17.0) almost
17-
# 3 years ago, and it was originally introduced one version before in 1.16
18-
# (although not enabled by default then). Can we safely assume that testers
19-
# will have a sufficiently new version of numpy to run these tests?
20-
class _Test:
21-
def __array_function__(self, *args, **kwargs):
22-
return True
11+
@pytest.fixture
12+
def rng():
13+
return np.random.default_rng(seed=0)
2314

2415

25-
try:
26-
np.concatenate([_Test()])
27-
except ValueError:
28-
missing_arrfunc_cond = True
29-
else:
30-
missing_arrfunc_cond = False
31-
32-
del _Test
33-
34-
missing_arrfunc_reason = "NEP-18 support is not available in NumPy"
35-
36-
rng = np.random.default_rng(seed=0)
37-
38-
39-
@pytest.mark.skipif(missing_arrfunc_cond, reason=missing_arrfunc_reason)
4016
@pytest.mark.parametrize(
4117
"func",
4218
[
@@ -48,7 +24,7 @@ def __array_function__(self, *args, **kwargs):
4824
lambda x: np.linalg.norm(x),
4925
],
5026
)
51-
def test_array_func_cudf_series(func):
27+
def test_array_func_cudf_series(func, rng):
5228
np_ar = rng.random(100)
5329
cudf_ser = cudf.Series(np_ar)
5430
expect = func(np_ar)
@@ -59,7 +35,6 @@ def test_array_func_cudf_series(func):
5935
assert_eq(expect, got.to_numpy())
6036

6137

62-
@pytest.mark.skipif(missing_arrfunc_cond, reason=missing_arrfunc_reason)
6338
@pytest.mark.parametrize(
6439
"func",
6540
[
@@ -73,15 +48,14 @@ def test_array_func_cudf_series(func):
7348
lambda x: np.prod(x, axis=1),
7449
],
7550
)
76-
def test_array_func_cudf_dataframe(func):
51+
def test_array_func_cudf_dataframe(func, rng):
7752
pd_df = pd.DataFrame(rng.uniform(size=(100, 10)))
7853
cudf_df = cudf.from_pandas(pd_df)
7954
expect = func(pd_df)
8055
got = func(cudf_df)
8156
assert_eq(expect, got)
8257

8358

84-
@pytest.mark.skipif(missing_arrfunc_cond, reason=missing_arrfunc_reason)
8559
@pytest.mark.parametrize(
8660
"func",
8761
[
@@ -90,21 +64,20 @@ def test_array_func_cudf_dataframe(func):
9064
lambda x: np.linalg.det(x),
9165
],
9266
)
93-
def test_array_func_missing_cudf_dataframe(func):
67+
def test_array_func_missing_cudf_dataframe(func, rng):
9468
pd_df = pd.DataFrame(rng.uniform(size=(100, 10)))
9569
cudf_df = cudf.from_pandas(pd_df)
9670
with pytest.raises(TypeError):
9771
func(cudf_df)
9872

9973

100-
@pytest.mark.skipif(missing_arrfunc_cond, reason=missing_arrfunc_reason)
10174
@pytest.mark.parametrize(
10275
"func",
10376
[
10477
lambda x: np.unique(x),
10578
],
10679
)
107-
def test_array_func_cudf_index(func):
80+
def test_array_func_cudf_index(func, rng):
10881
np_ar = rng.random(100)
10982
cudf_index = cudf.Index(cudf.Series(np_ar))
11083
expect = func(np_ar)
@@ -115,7 +88,6 @@ def test_array_func_cudf_index(func):
11588
assert_eq(expect, got.to_numpy())
11689

11790

118-
@pytest.mark.skipif(missing_arrfunc_cond, reason=missing_arrfunc_reason)
11991
@pytest.mark.parametrize(
12092
"func",
12193
[
@@ -124,14 +96,13 @@ def test_array_func_cudf_index(func):
12496
lambda x: np.linalg.det(x),
12597
],
12698
)
127-
def test_array_func_missing_cudf_index(func):
99+
def test_array_func_missing_cudf_index(func, rng):
128100
np_ar = rng.random(100)
129101
cudf_index = cudf.Index(cudf.Series(np_ar))
130102
with pytest.raises(TypeError):
131103
func(cudf_index)
132104

133105

134-
@pytest.mark.skipif(missing_arrfunc_cond, reason=missing_arrfunc_reason)
135106
@pytest.mark.parametrize(
136107
"func",
137108
[
@@ -150,7 +121,6 @@ def test_array_func_missing_cudf_multi_index(func):
150121
func(cudf_multi_index)
151122

152123

153-
@pytest.mark.skipif(missing_arrfunc_cond, reason=missing_arrfunc_reason)
154124
def test_list_input_array_func():
155125
ar = np.array([1, 2, 3])
156126

python/cudf/cudf/tests/test_array_ufunc.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,16 @@
1919
from cudf.testing import assert_eq
2020
from cudf.testing._utils import expect_warning_if, set_random_null_mask_inplace
2121

22-
_UFUNCS = [
23-
obj
24-
for obj in (getattr(np, name) for name in dir(np))
25-
if isinstance(obj, np.ufunc)
26-
]
22+
23+
@pytest.fixture(
24+
params=[
25+
obj
26+
for obj in (getattr(np, name) for name in dir(np))
27+
if isinstance(obj, np.ufunc)
28+
]
29+
)
30+
def ufunc(request):
31+
return request.param
2732

2833

2934
@contextmanager
@@ -72,7 +77,6 @@ def _hide_ufunc_warnings(ufunc):
7277
yield
7378

7479

75-
@pytest.mark.parametrize("ufunc", _UFUNCS)
7680
def test_ufunc_index(request, ufunc):
7781
# Note: This test assumes that all ufuncs are unary or binary.
7882
fname = ufunc.__name__
@@ -157,7 +161,6 @@ def test_binary_ufunc_index_array(ufunc, reflect):
157161
PANDAS_VERSION < PANDAS_CURRENT_SUPPORTED_VERSION,
158162
reason="warning not present in older pandas versions",
159163
)
160-
@pytest.mark.parametrize("ufunc", _UFUNCS)
161164
@pytest.mark.parametrize("has_nulls", [True, False])
162165
@pytest.mark.parametrize("indexed", [True, False])
163166
def test_ufunc_series(request, ufunc, has_nulls, indexed):
@@ -367,7 +370,6 @@ def test_ufunc_cudf_series_error_with_out_kwarg(func):
367370
PANDAS_VERSION < PANDAS_CURRENT_SUPPORTED_VERSION,
368371
reason="warning not present in older pandas versions",
369372
)
370-
@pytest.mark.parametrize("ufunc", (uf for uf in _UFUNCS if uf != np.matmul))
371373
@pytest.mark.parametrize("has_nulls", [True, False])
372374
@pytest.mark.parametrize("indexed", [True, False])
373375
def test_ufunc_dataframe(request, ufunc, has_nulls, indexed):
@@ -407,6 +409,12 @@ def test_ufunc_dataframe(request, ufunc, has_nulls, indexed):
407409
reason="https://github.com/cupy/cupy/issues/9018",
408410
)
409411
)
412+
request.applymarker(
413+
pytest.mark.xfail(
414+
condition=fname == "matmul",
415+
reason=f"{fname} is not supported in cuDF",
416+
)
417+
)
410418

411419
N = 100
412420
# Avoid zeros in either array to skip division by 0 errors. Also limit the

python/cudf/cudf/tests/test_avro_reader_fastavro_integration.py

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,36 @@ def cudf_from_avro_util(schema: dict, records: list) -> cudf.DataFrame:
3636
return cudf.read_avro(buffer)
3737

3838

39-
avro_type_params = [
40-
("boolean", "bool"),
41-
("int", "int32"),
42-
("long", "int64"),
43-
("float", "float32"),
44-
("double", "float64"),
45-
("bytes", "str"),
46-
("string", "str"),
47-
]
48-
49-
50-
@pytest.mark.parametrize("avro_type, expected_dtype", avro_type_params)
39+
@pytest.fixture(
40+
params=[
41+
("boolean", "bool"),
42+
("int", "int32"),
43+
("long", "int64"),
44+
("float", "float32"),
45+
("double", "float64"),
46+
("bytes", "str"),
47+
("string", "str"),
48+
]
49+
)
50+
def avro_type_params(request):
51+
return request.param
52+
53+
54+
@pytest.fixture(params=[True, False])
55+
def nullable(request):
56+
return request.param
57+
58+
59+
@pytest.fixture(params=[True, False])
60+
def prepend_null(request):
61+
return request.param
62+
63+
5164
@pytest.mark.parametrize("namespace", [None, "root_ns"])
52-
@pytest.mark.parametrize("nullable", [True, False])
5365
def test_can_detect_dtype_from_avro_type(
54-
avro_type, expected_dtype, namespace, nullable
66+
avro_type_params, namespace, nullable
5567
):
68+
avro_type, expected_dtype = avro_type_params
5669
avro_type = avro_type if not nullable else ["null", avro_type]
5770

5871
schema = fastavro.parse_schema(
@@ -73,12 +86,11 @@ def test_can_detect_dtype_from_avro_type(
7386
assert_eq(expected, actual)
7487

7588

76-
@pytest.mark.parametrize("avro_type, expected_dtype", avro_type_params)
7789
@pytest.mark.parametrize("namespace", [None, "root_ns"])
78-
@pytest.mark.parametrize("nullable", [True, False])
7990
def test_can_detect_dtype_from_avro_type_nested(
80-
avro_type, expected_dtype, namespace, nullable
91+
avro_type_params, namespace, nullable
8192
):
93+
avro_type, expected_dtype = avro_type_params
8294
avro_type = avro_type if not nullable else ["null", avro_type]
8395

8496
schema_leaf = {
@@ -146,8 +158,8 @@ def test_can_parse_single_value(avro_type, cudf_type, avro_val, cudf_val):
146158
assert_eq(expected, actual)
147159

148160

149-
@pytest.mark.parametrize("avro_type, cudf_type", avro_type_params)
150-
def test_can_parse_single_null(avro_type, cudf_type):
161+
def test_can_parse_single_null(avro_type_params):
162+
avro_type, expected_dtype = avro_type_params
151163
schema_root = {
152164
"name": "root",
153165
"type": "record",
@@ -159,14 +171,14 @@ def test_can_parse_single_null(avro_type, cudf_type):
159171
actual = cudf_from_avro_util(schema_root, records)
160172

161173
expected = cudf.DataFrame(
162-
{"prop": cudf.Series(data=[None], dtype=cudf_type)}
174+
{"prop": cudf.Series(data=[None], dtype=expected_dtype)}
163175
)
164176

165177
assert_eq(expected, actual)
166178

167179

168-
@pytest.mark.parametrize("avro_type, cudf_type", avro_type_params)
169-
def test_can_parse_no_data(avro_type, cudf_type):
180+
def test_can_parse_no_data(avro_type_params):
181+
avro_type, expected_dtype = avro_type_params
170182
schema_root = {
171183
"name": "root",
172184
"type": "record",
@@ -177,16 +189,18 @@ def test_can_parse_no_data(avro_type, cudf_type):
177189

178190
actual = cudf_from_avro_util(schema_root, records)
179191

180-
expected = cudf.DataFrame({"prop": cudf.Series(data=[], dtype=cudf_type)})
192+
expected = cudf.DataFrame(
193+
{"prop": cudf.Series(data=[], dtype=expected_dtype)}
194+
)
181195

182196
assert_eq(expected, actual)
183197

184198

185199
@pytest.mark.xfail(
186200
reason="cudf avro reader is unable to parse zero-field metadata."
187201
)
188-
@pytest.mark.parametrize("avro_type, cudf_type", avro_type_params)
189-
def test_can_parse_no_fields(avro_type, cudf_type):
202+
def test_can_parse_no_fields(avro_type_params):
203+
avro_type, expected_dtype = avro_type_params
190204
schema_root = {
191205
"name": "root",
192206
"type": "record",
@@ -251,26 +265,15 @@ def test_avro_decompression(set_decomp_env_vars, rows, codec):
251265
assert_eq(expected_df, got_df)
252266

253267

254-
avro_logical_type_params = [
255-
# (avro logical type, avro primitive type, cudf expected dtype)
256-
("date", "int", "datetime64[s]"),
257-
]
258-
259-
260-
@pytest.mark.parametrize(
261-
"logical_type, primitive_type, expected_dtype", avro_logical_type_params
262-
)
263268
@pytest.mark.parametrize("namespace", [None, "root_ns"])
264-
@pytest.mark.parametrize("nullable", [True, False])
265-
@pytest.mark.parametrize("prepend_null", [True, False])
266269
def test_can_detect_dtypes_from_avro_logical_type(
267-
logical_type,
268-
primitive_type,
269-
expected_dtype,
270270
namespace,
271271
nullable,
272272
prepend_null,
273273
):
274+
logical_type = "date"
275+
primitive_type = "int"
276+
expected_dtype = "datetime64[s]"
274277
avro_type = [{"logicalType": logical_type, "type": primitive_type}]
275278
if nullable:
276279
if prepend_null:
@@ -303,8 +306,6 @@ def get_days_from_epoch(date: datetime.date | None) -> int | None:
303306

304307

305308
@pytest.mark.parametrize("namespace", [None, "root_ns"])
306-
@pytest.mark.parametrize("nullable", [True, False])
307-
@pytest.mark.parametrize("prepend_null", [True, False])
308309
@pytest.mark.skipif(
309310
PANDAS_VERSION < PANDAS_CURRENT_SUPPORTED_VERSION,
310311
reason="Fails in older versions of pandas (datetime(9999, ...) too large)",

0 commit comments

Comments
 (0)