@@ -38,23 +38,34 @@ def test_concat_empty_dataframe_dtypes(self):
38
38
def test_empty_frame_dtypes_ftypes (self ):
39
39
empty_df = pd .DataFrame ()
40
40
assert_series_equal (empty_df .dtypes , pd .Series (dtype = np .object ))
41
- assert_series_equal (empty_df .ftypes , pd .Series (dtype = np .object ))
41
+
42
+ # GH 26705 - Assert .ftypes is deprecated
43
+ with tm .assert_produces_warning (FutureWarning ):
44
+ assert_series_equal (empty_df .ftypes , pd .Series (dtype = np .object ))
42
45
43
46
nocols_df = pd .DataFrame (index = [1 , 2 , 3 ])
44
47
assert_series_equal (nocols_df .dtypes , pd .Series (dtype = np .object ))
45
- assert_series_equal (nocols_df .ftypes , pd .Series (dtype = np .object ))
48
+
49
+ # GH 26705 - Assert .ftypes is deprecated
50
+ with tm .assert_produces_warning (FutureWarning ):
51
+ assert_series_equal (nocols_df .ftypes , pd .Series (dtype = np .object ))
46
52
47
53
norows_df = pd .DataFrame (columns = list ("abc" ))
48
54
assert_series_equal (norows_df .dtypes , pd .Series (
49
55
np .object , index = list ("abc" )))
50
- assert_series_equal (norows_df .ftypes , pd .Series (
51
- 'object:dense' , index = list ("abc" )))
56
+
57
+ # GH 26705 - Assert .ftypes is deprecated
58
+ with tm .assert_produces_warning (FutureWarning ):
59
+ assert_series_equal (norows_df .ftypes , pd .Series (
60
+ 'object:dense' , index = list ("abc" )))
52
61
53
62
norows_int_df = pd .DataFrame (columns = list ("abc" )).astype (np .int32 )
54
63
assert_series_equal (norows_int_df .dtypes , pd .Series (
55
64
np .dtype ('int32' ), index = list ("abc" )))
56
- assert_series_equal (norows_int_df .ftypes , pd .Series (
57
- 'int32:dense' , index = list ("abc" )))
65
+ # GH 26705 - Assert .ftypes is deprecated
66
+ with tm .assert_produces_warning (FutureWarning ):
67
+ assert_series_equal (norows_int_df .ftypes , pd .Series (
68
+ 'int32:dense' , index = list ("abc" )))
58
69
59
70
odict = OrderedDict
60
71
df = pd .DataFrame (odict ([('a' , 1 ), ('b' , True ), ('c' , 1.0 )]),
@@ -66,11 +77,17 @@ def test_empty_frame_dtypes_ftypes(self):
66
77
('b' , 'bool:dense' ),
67
78
('c' , 'float64:dense' )]))
68
79
assert_series_equal (df .dtypes , ex_dtypes )
69
- assert_series_equal (df .ftypes , ex_ftypes )
80
+
81
+ # GH 26705 - Assert .ftypes is deprecated
82
+ with tm .assert_produces_warning (FutureWarning ):
83
+ assert_series_equal (df .ftypes , ex_ftypes )
70
84
71
85
# same but for empty slice of df
72
86
assert_series_equal (df [:0 ].dtypes , ex_dtypes )
73
- assert_series_equal (df [:0 ].ftypes , ex_ftypes )
87
+
88
+ # GH 26705 - Assert .ftypes is deprecated
89
+ with tm .assert_produces_warning (FutureWarning ):
90
+ assert_series_equal (df [:0 ].ftypes , ex_ftypes )
74
91
75
92
def test_datetime_with_tz_dtypes (self ):
76
93
tzframe = DataFrame ({'A' : date_range ('20130101' , periods = 3 ),
@@ -402,7 +419,10 @@ def test_ftypes(self):
402
419
B = 'float32:dense' ,
403
420
C = 'float16:dense' ,
404
421
D = 'float64:dense' )).sort_values ()
405
- result = frame .ftypes .sort_values ()
422
+
423
+ # GH 26705 - Assert .ftypes is deprecated
424
+ with tm .assert_produces_warning (FutureWarning ):
425
+ result = frame .ftypes .sort_values ()
406
426
assert_series_equal (result , expected )
407
427
408
428
def test_astype (self ):
0 commit comments