1
1
import pytest
2
2
3
- from pandas .util ._exceptions import Pandas40DeprecationWarning
3
+ from pandas .util ._exceptions import CurrentDeprecationWarning
4
4
5
5
import pandas as pd
6
6
from pandas import (
@@ -40,34 +40,34 @@ def test_copy_deprecation(meth, kwargs):
40
40
df = df .set_index (["b" , "c" ])
41
41
42
42
if meth != "swaplevel" :
43
- with tm .assert_produces_warning (Pandas40DeprecationWarning , match = "copy" ):
43
+ with tm .assert_produces_warning (CurrentDeprecationWarning , match = "copy" ):
44
44
getattr (df , meth )(copy = False , ** kwargs )
45
45
46
46
if meth != "transpose" :
47
- with tm .assert_produces_warning (Pandas40DeprecationWarning , match = "copy" ):
47
+ with tm .assert_produces_warning (CurrentDeprecationWarning , match = "copy" ):
48
48
getattr (df .a , meth )(copy = False , ** kwargs )
49
49
50
50
51
51
def test_copy_deprecation_reindex_like_align ():
52
52
df = pd .DataFrame ({"a" : [1 , 2 , 3 ], "b" : [4 , 5 , 6 ]})
53
53
# Somehow the stack level check is incorrect here
54
54
with tm .assert_produces_warning (
55
- Pandas40DeprecationWarning , match = "copy" , check_stacklevel = False
55
+ CurrentDeprecationWarning , match = "copy" , check_stacklevel = False
56
56
):
57
57
df .reindex_like (df , copy = False )
58
58
59
59
with tm .assert_produces_warning (
60
- Pandas40DeprecationWarning , match = "copy" , check_stacklevel = False
60
+ CurrentDeprecationWarning , match = "copy" , check_stacklevel = False
61
61
):
62
62
df .a .reindex_like (df .a , copy = False )
63
63
64
64
with tm .assert_produces_warning (
65
- Pandas40DeprecationWarning , match = "copy" , check_stacklevel = False
65
+ CurrentDeprecationWarning , match = "copy" , check_stacklevel = False
66
66
):
67
67
df .align (df , copy = False )
68
68
69
69
with tm .assert_produces_warning (
70
- Pandas40DeprecationWarning , match = "copy" , check_stacklevel = False
70
+ CurrentDeprecationWarning , match = "copy" , check_stacklevel = False
71
71
):
72
72
df .a .align (df .a , copy = False )
73
73
@@ -76,16 +76,16 @@ def test_copy_deprecation_merge_concat():
76
76
df = pd .DataFrame ({"a" : [1 , 2 , 3 ], "b" : [4 , 5 , 6 ]})
77
77
78
78
with tm .assert_produces_warning (
79
- Pandas40DeprecationWarning , match = "copy" , check_stacklevel = False
79
+ CurrentDeprecationWarning , match = "copy" , check_stacklevel = False
80
80
):
81
81
df .merge (df , copy = False )
82
82
83
83
with tm .assert_produces_warning (
84
- Pandas40DeprecationWarning , match = "copy" , check_stacklevel = False
84
+ CurrentDeprecationWarning , match = "copy" , check_stacklevel = False
85
85
):
86
86
merge (df , df , copy = False )
87
87
88
88
with tm .assert_produces_warning (
89
- Pandas40DeprecationWarning , match = "copy" , check_stacklevel = False
89
+ CurrentDeprecationWarning , match = "copy" , check_stacklevel = False
90
90
):
91
91
concat ([df , df ], copy = False )
0 commit comments