@@ -70,7 +70,7 @@ def max_value(group):
70
70
return group .loc [group ["value" ].idxmax ()]
71
71
72
72
msg = "DataFrameGroupBy.apply operated on the grouping columns"
73
- with tm .assert_produces_warning (FutureWarning , match = msg ):
73
+ with tm .assert_produces_warning (DeprecationWarning , match = msg ):
74
74
applied = df .groupby ("A" ).apply (max_value )
75
75
result = applied .dtypes
76
76
expected = df .dtypes
@@ -203,9 +203,9 @@ def f3(x):
203
203
204
204
# correct result
205
205
msg = "DataFrameGroupBy.apply operated on the grouping columns"
206
- with tm .assert_produces_warning (FutureWarning , match = msg ):
206
+ with tm .assert_produces_warning (DeprecationWarning , match = msg ):
207
207
result1 = df .groupby ("a" ).apply (f1 )
208
- with tm .assert_produces_warning (FutureWarning , match = msg ):
208
+ with tm .assert_produces_warning (DeprecationWarning , match = msg ):
209
209
result2 = df2 .groupby ("a" ).apply (f1 )
210
210
tm .assert_frame_equal (result1 , result2 )
211
211
@@ -1092,13 +1092,13 @@ def summarize_random_name(df):
1092
1092
return Series ({"count" : 1 , "mean" : 2 , "omissions" : 3 }, name = df .iloc [0 ]["A" ])
1093
1093
1094
1094
msg = "DataFrameGroupBy.apply operated on the grouping columns"
1095
- with tm .assert_produces_warning (FutureWarning , match = msg ):
1095
+ with tm .assert_produces_warning (DeprecationWarning , match = msg ):
1096
1096
metrics = df .groupby ("A" ).apply (summarize )
1097
1097
assert metrics .columns .name is None
1098
- with tm .assert_produces_warning (FutureWarning , match = msg ):
1098
+ with tm .assert_produces_warning (DeprecationWarning , match = msg ):
1099
1099
metrics = df .groupby ("A" ).apply (summarize , "metrics" )
1100
1100
assert metrics .columns .name == "metrics"
1101
- with tm .assert_produces_warning (FutureWarning , match = msg ):
1101
+ with tm .assert_produces_warning (DeprecationWarning , match = msg ):
1102
1102
metrics = df .groupby ("A" ).apply (summarize_random_name )
1103
1103
assert metrics .columns .name is None
1104
1104
@@ -1393,7 +1393,7 @@ def test_dont_clobber_name_column():
1393
1393
)
1394
1394
1395
1395
msg = "DataFrameGroupBy.apply operated on the grouping columns"
1396
- with tm .assert_produces_warning (FutureWarning , match = msg ):
1396
+ with tm .assert_produces_warning (DeprecationWarning , match = msg ):
1397
1397
result = df .groupby ("key" , group_keys = False ).apply (lambda x : x )
1398
1398
tm .assert_frame_equal (result , df )
1399
1399
@@ -1477,7 +1477,7 @@ def freducex(x):
1477
1477
1478
1478
# make sure all these work
1479
1479
msg = "DataFrameGroupBy.apply operated on the grouping columns"
1480
- with tm .assert_produces_warning (FutureWarning , match = msg ):
1480
+ with tm .assert_produces_warning (DeprecationWarning , match = msg ):
1481
1481
grouped .apply (f )
1482
1482
grouped .aggregate (freduce )
1483
1483
grouped .aggregate ({"C" : freduce , "D" : freduce })
@@ -1500,7 +1500,7 @@ def f(group):
1500
1500
return group .copy ()
1501
1501
1502
1502
msg = "DataFrameGroupBy.apply operated on the grouping columns"
1503
- with tm .assert_produces_warning (FutureWarning , match = msg ):
1503
+ with tm .assert_produces_warning (DeprecationWarning , match = msg ):
1504
1504
df .groupby ("a" , sort = False , group_keys = False ).apply (f )
1505
1505
1506
1506
expected_names = [0 , 1 , 2 ]
@@ -1708,7 +1708,7 @@ def test_sort(x):
1708
1708
tm .assert_frame_equal (x , x .sort_values (by = sort_column ))
1709
1709
1710
1710
msg = "DataFrameGroupBy.apply operated on the grouping columns"
1711
- with tm .assert_produces_warning (FutureWarning , match = msg ):
1711
+ with tm .assert_produces_warning (DeprecationWarning , match = msg ):
1712
1712
g .apply (test_sort )
1713
1713
1714
1714
@@ -1893,7 +1893,7 @@ def test_empty_groupby_apply_nonunique_columns():
1893
1893
df .columns = [0 , 1 , 2 , 0 ]
1894
1894
gb = df .groupby (df [1 ], group_keys = False )
1895
1895
msg = "DataFrameGroupBy.apply operated on the grouping columns"
1896
- with tm .assert_produces_warning (FutureWarning , match = msg ):
1896
+ with tm .assert_produces_warning (DeprecationWarning , match = msg ):
1897
1897
res = gb .apply (lambda x : x )
1898
1898
assert (res .dtypes == df .dtypes ).all ()
1899
1899
0 commit comments