@@ -64,16 +64,22 @@ def test_to_dict_index_not_unique_with_index_orient(self):
64
64
with pytest .raises (ValueError , match = msg ):
65
65
df .to_dict (orient = "index" )
66
66
67
- @pytest .mark .parametrize ("orient" , ["d" , "l" , "r" , "sp" , "s" , "i" , " xinvalid" ])
67
+ @pytest .mark .parametrize ("orient" , ["xinvalid" ])
68
68
def test_to_dict_invalid_orient (self , orient ):
69
- # to_dict(orient='d') should fail, as should only take the listed options
70
- # see GH#32515
71
-
72
69
df = DataFrame ({"A" : [0 , 1 ]})
73
70
msg = f"orient '{ orient } ' not understood"
74
71
with pytest .raises (ValueError , match = msg ):
75
72
df .to_dict (orient = orient )
76
73
74
+ @pytest .mark .parametrize ("orient" , ["d" , "l" , "r" , "sp" , "s" , "i" ])
75
+ def test_to_dict_short_orient (self , orient ):
76
+ # to_dict(orient='d') or any other short option should raise DeprecationWarning
77
+ # see GH#32515
78
+ df = DataFrame ({"A" : [0 , 1 ]})
79
+ with pytest .warns (DeprecationWarning ):
80
+ df .to_dict (orient = orient )
81
+
82
+
77
83
@pytest .mark .parametrize ("mapping" , [dict , defaultdict (list ), OrderedDict ])
78
84
def test_to_dict (self , mapping ):
79
85
# orient= should only take the listed options
0 commit comments