From d758590ce04c95a0276aa367d19bd05b20447614 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Sun, 6 Sep 2026 09:23:25 -0700 Subject: [PATCH 1/4] TEST: Reduce covariance correlation test matrix --- .../tests/series/methods/test_cov_corr.py | 82 ++++++++----------- 1 file changed, 35 insertions(+), 47 deletions(-) diff --git a/python/cudf/cudf/tests/series/methods/test_cov_corr.py b/python/cudf/cudf/tests/series/methods/test_cov_corr.py index 2929929f06bb..08cc0370af3a 100644 --- a/python/cudf/cudf/tests/series/methods/test_cov_corr.py +++ b/python/cudf/cudf/tests/series/methods/test_cov_corr.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 @@ -11,33 +11,46 @@ from cudf.testing import assert_eq from cudf.testing._utils import expect_warning_if - -@pytest.mark.parametrize( - "data1", - [ +COV_CORR_DATA_PAIRS = [ + pytest.param( + np.random.default_rng(seed=0).normal(-100, 100, 1000), np.random.default_rng(seed=0).normal(-100, 100, 1000), + id="normal", + ), + pytest.param( np.random.default_rng(seed=0).integers(-50, 50, 1000), - np.zeros(100), - np.repeat(np.nan, 100), + np.random.default_rng(seed=0).integers(-50, 50, 1000), + id="integers", + ), + pytest.param(np.zeros(100), np.zeros(100), id="constant"), + pytest.param( + np.repeat(np.nan, 100), np.repeat(np.nan, 100), id="all-null" + ), + pytest.param( + np.array([1.123, 2.343, np.nan, 0.0]), np.array([1.123, 2.343, np.nan, 0.0]), + id="nullable", + ), + pytest.param( pa.array([5, 10, 53, None, np.nan, None]), + pd.Series([1.1, 2.32, 43.4], index=[0, 500, 4000]), + id="arrow-and-indexed-series", + ), + pytest.param( pd.Series([1.1, 2.32, 43.4], index=[0, 4, 3]), - np.array([], dtype="float64"), + pd.Series([1.1, 2.32, 43.4], index=[0, 500, 4000]), + id="indexed-series", + ), + pytest.param(np.array([], dtype="float64"), np.array([5]), id="empty"), + pytest.param( np.array([-3]), - ], -) -@pytest.mark.parametrize( - "data2", - [ np.random.default_rng(seed=0).normal(-100, 100, 1000), - np.random.default_rng(seed=0).integers(-50, 50, 1000), - np.zeros(100), - np.repeat(np.nan, 100), - np.array([1.123, 2.343, np.nan, 0.0]), - pd.Series([1.1, 2.32, 43.4], index=[0, 500, 4000]), - np.array([5]), - ], -) + id="singleton", + ), +] + + +@pytest.mark.parametrize(("data1", "data2"), COV_CORR_DATA_PAIRS) def test_cov1d(data1, data2): gs1 = cudf.Series(data1) gs2 = cudf.Series(data2) @@ -56,32 +69,7 @@ def test_cov1d(data1, data2): np.testing.assert_approx_equal(got, expected, significant=8) -@pytest.mark.parametrize( - "data1", - [ - np.random.default_rng(seed=0).normal(-100, 100, 1000), - np.random.default_rng(seed=0).integers(-50, 50, 1000), - np.zeros(100), - np.repeat(np.nan, 100), - np.array([1.123, 2.343, np.nan, 0.0]), - pa.array([5, 10, 53, None, np.nan, None]), - pd.Series([1.1032, 2.32, 43.4], index=[0, 4, 3]), - np.array([], dtype="float64"), - np.array([-3]), - ], -) -@pytest.mark.parametrize( - "data2", - [ - np.random.default_rng(seed=0).normal(-100, 100, 1000), - np.random.default_rng(seed=0).integers(-50, 50, 1000), - np.zeros(100), - np.repeat(np.nan, 100), - np.array([1.123, 2.343, np.nan, 0.0]), - pd.Series([1.1, 2.32, 43.4], index=[0, 500, 4000]), - np.array([5]), - ], -) +@pytest.mark.parametrize(("data1", "data2"), COV_CORR_DATA_PAIRS) def test_corr1d(data1, data2, corr_method): if corr_method == "spearman": # Pandas uses scipy.stats.spearmanr code-path From 9c52a2618a1ea86894402c202cd385f51297d0a0 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Sun, 6 Sep 2026 16:51:09 -0700 Subject: [PATCH 2/4] TEST: Remove unused extension compilation type parameter --- .../cudf/tests/private_objects/test_extension_compilation.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/cudf/cudf/tests/private_objects/test_extension_compilation.py b/python/cudf/cudf/tests/private_objects/test_extension_compilation.py index 74f81d97509a..01f0b13626ee 100644 --- a/python/cudf/cudf/tests/private_objects/test_extension_compilation.py +++ b/python/cudf/cudf/tests/private_objects/test_extension_compilation.py @@ -72,8 +72,7 @@ def func(x): @pytest.mark.parametrize("op", arith_ops) -@pytest.mark.parametrize("ty", number_types, ids=number_ids) -def test_execute_masked_binary(op, ty): +def test_execute_masked_binary(op): @cuda.jit(device=True) def func(x, y): return op(x, y) From 8550120a4e7f70242322443855b00ae61074bb8d Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Mon, 7 Sep 2026 08:20:47 -0700 Subject: [PATCH 3/4] TEST: Align covariance correlation test inputs --- python/cudf/cudf/tests/series/methods/test_cov_corr.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/cudf/cudf/tests/series/methods/test_cov_corr.py b/python/cudf/cudf/tests/series/methods/test_cov_corr.py index 08cc0370af3a..d0e856574b36 100644 --- a/python/cudf/cudf/tests/series/methods/test_cov_corr.py +++ b/python/cudf/cudf/tests/series/methods/test_cov_corr.py @@ -33,12 +33,12 @@ ), pytest.param( pa.array([5, 10, 53, None, np.nan, None]), - pd.Series([1.1, 2.32, 43.4], index=[0, 500, 4000]), - id="arrow-and-indexed-series", + np.array([1.0, 4.0, 9.0, np.nan, 16.0, 25.0]), + id="arrow", ), pytest.param( pd.Series([1.1, 2.32, 43.4], index=[0, 4, 3]), - pd.Series([1.1, 2.32, 43.4], index=[0, 500, 4000]), + pd.Series([43.4, 1.1, 2.32], index=[3, 0, 4]), id="indexed-series", ), pytest.param(np.array([], dtype="float64"), np.array([5]), id="empty"), From e111ba53238b28251ff85de18c15de6c1c359653 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 8 Sep 2026 08:44:09 -0700 Subject: [PATCH 4/4] TEST: Preserve mixed covariance correlation inputs --- python/cudf/cudf/tests/series/methods/test_cov_corr.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/cudf/cudf/tests/series/methods/test_cov_corr.py b/python/cudf/cudf/tests/series/methods/test_cov_corr.py index d0e856574b36..4b57f1d44ab3 100644 --- a/python/cudf/cudf/tests/series/methods/test_cov_corr.py +++ b/python/cudf/cudf/tests/series/methods/test_cov_corr.py @@ -14,13 +14,13 @@ COV_CORR_DATA_PAIRS = [ pytest.param( np.random.default_rng(seed=0).normal(-100, 100, 1000), - np.random.default_rng(seed=0).normal(-100, 100, 1000), - id="normal", + np.random.default_rng(seed=0).integers(-50, 50, 1000), + id="normal-integers", ), pytest.param( np.random.default_rng(seed=0).integers(-50, 50, 1000), - np.random.default_rng(seed=0).integers(-50, 50, 1000), - id="integers", + np.random.default_rng(seed=0).normal(-100, 100, 1000), + id="integers-normal", ), pytest.param(np.zeros(100), np.zeros(100), id="constant"), pytest.param(