@@ -524,10 +524,33 @@ def func(df):
524524 reason = "Include groups missing on old versions of pandas" ,
525525)
526526def 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):
589612def 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(
621644def 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)
673696def 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