|
33 | 33 | TIMEDELTA_TYPES,
|
34 | 34 | assert_eq,
|
35 | 35 | assert_exceptions_equal,
|
36 |
| - expect_warning_if, |
37 | 36 | )
|
38 | 37 | from cudf.testing.dataset_generator import rand_dataframe
|
39 | 38 |
|
@@ -982,8 +981,7 @@ def test_groupby_unsupported_columns():
|
982 | 981 | )
|
983 | 982 | pdf["b"] = pd_cat
|
984 | 983 | gdf = cudf.from_pandas(pdf)
|
985 |
| - with pytest.warns(FutureWarning): |
986 |
| - pdg = pdf.groupby("x").sum() |
| 984 | + pdg = pdf.groupby("x").sum(numeric_only=True) |
987 | 985 | # cudf does not yet support numeric_only, so our default is False (unlike
|
988 | 986 | # pandas, which defaults to inferring and throws a warning about it).
|
989 | 987 | gdg = gdf.groupby("x").sum()
|
@@ -1547,15 +1545,11 @@ def test_grouping(grouper):
|
1547 | 1545 | )
|
1548 | 1546 | gdf = cudf.from_pandas(pdf)
|
1549 | 1547 |
|
1550 |
| - # There's no easy way to validate that the same warning is thrown by both |
1551 |
| - # cudf and pandas here because it's only thrown upon iteration, so we |
1552 |
| - # settle for catching warnings on the whole block. |
1553 |
| - with expect_warning_if(isinstance(grouper, list) and len(grouper) == 1): |
1554 |
| - for pdf_group, gdf_group in zip( |
1555 |
| - pdf.groupby(grouper), gdf.groupby(grouper) |
1556 |
| - ): |
1557 |
| - assert pdf_group[0] == gdf_group[0] |
1558 |
| - assert_eq(pdf_group[1], gdf_group[1]) |
| 1548 | + for pdf_group, gdf_group in zip( |
| 1549 | + pdf.groupby(grouper), gdf.groupby(grouper) |
| 1550 | + ): |
| 1551 | + assert pdf_group[0] == gdf_group[0] |
| 1552 | + assert_eq(pdf_group[1], gdf_group[1]) |
1559 | 1553 |
|
1560 | 1554 |
|
1561 | 1555 | @pytest.mark.parametrize("agg", [lambda x: x.count(), "count"])
|
@@ -3311,8 +3305,8 @@ def test_head_tail_empty():
|
3311 | 3305 |
|
3312 | 3306 | expected = pdf.groupby(pd.Series(values)).head()
|
3313 | 3307 | got = df.groupby(cudf.Series(values)).head()
|
3314 |
| - assert_eq(expected, got) |
| 3308 | + assert_eq(expected, got, check_column_type=not PANDAS_GE_200) |
3315 | 3309 |
|
3316 | 3310 | expected = pdf.groupby(pd.Series(values)).tail()
|
3317 | 3311 | got = df.groupby(cudf.Series(values)).tail()
|
3318 |
| - assert_eq(expected, got) |
| 3312 | + assert_eq(expected, got, check_column_type=not PANDAS_GE_200) |
0 commit comments