Skip to content

Commit 2e982e2

Browse files
committed
Merge branch 'branch-25.08' into branch-25.10-merge-branch-25.08
2 parents 8222329 + a8f9336 commit 2e982e2

File tree

1 file changed

+29
-6
lines changed

1 file changed

+29
-6
lines changed

python/cudf/cudf/tests/test_groupby.py

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -524,10 +524,33 @@ def func(df):
524524
reason="Include groups missing on old versions of pandas",
525525
)
526526
def test_groupby_apply_jit_unary_reductions(
527-
func, dtype, dataset, groupby_jit_datasets
527+
request, func, dtype, dataset, groupby_jit_datasets
528528
):
529-
dataset = groupby_jit_datasets[dataset]
530-
groupby_apply_jit_reductions_test_inner(func, dataset, dtype)
529+
request.applymarker(
530+
pytest.mark.xfail(
531+
condition=(
532+
(
533+
dataset == "nans"
534+
and func in {"var", "std", "mean"}
535+
and str(dtype) in {"int64", "float32", "float64"}
536+
)
537+
or (
538+
dataset == "nans"
539+
and func in {"idxmax", "idxmin", "sum"}
540+
and dtype.kind == "f"
541+
)
542+
),
543+
reason=("https://github.com/rapidsai/cudf/issues/14860"),
544+
)
545+
)
546+
warn_condition = (
547+
dataset == "nans"
548+
and func in {"idxmax", "idxmin"}
549+
and dtype.kind == "f"
550+
)
551+
dataset = groupby_jit_datasets[dataset].copy(deep=True)
552+
with expect_warning_if(warn_condition, FutureWarning):
553+
groupby_apply_jit_reductions_test_inner(func, dataset, dtype)
531554

532555

533556
# test unary reductions for special values
@@ -589,7 +612,7 @@ def func(df):
589612
def test_groupby_apply_jit_reductions_special_vals(
590613
func, dtype, dataset, groupby_jit_datasets, special_val
591614
):
592-
dataset = groupby_jit_datasets[dataset]
615+
dataset = groupby_jit_datasets[dataset].copy(deep=True)
593616
with expect_warning_if(
594617
func in {"var", "std"} and not np.isnan(special_val), RuntimeWarning
595618
):
@@ -621,7 +644,7 @@ def test_groupby_apply_jit_reductions_special_vals(
621644
def test_groupby_apply_jit_idx_reductions_special_vals(
622645
func, dtype, dataset, groupby_jit_datasets, special_val
623646
):
624-
dataset = groupby_jit_datasets[dataset]
647+
dataset = groupby_jit_datasets[dataset].copy(deep=True)
625648
groupby_apply_jit_idx_reductions_special_vals_inner(
626649
func, dataset, dtype, special_val
627650
)
@@ -671,7 +694,7 @@ def func(group):
671694
reason="Fails in older versions of pandas",
672695
)
673696
def test_groupby_apply_jit_correlation(dataset, groupby_jit_datasets, dtype):
674-
dataset = groupby_jit_datasets[dataset]
697+
dataset = groupby_jit_datasets[dataset].copy(deep=True)
675698

676699
dataset["val1"] = dataset["val1"].astype(dtype)
677700
dataset["val2"] = dataset["val2"].astype(dtype)

0 commit comments

Comments
 (0)