@@ -167,6 +167,35 @@ def test_append_dtypes(self):
167
167
expected = DataFrame ({"bar" : Series ([Timestamp ("20130101" ), 1 ])})
168
168
tm .assert_frame_equal (result , expected )
169
169
170
+ df = pd .DataFrame ([1 ], dtype = pd .Int64Dtype ())
171
+ result = df .append (df .iloc [0 ]).iloc [- 1 ]
172
+ expected = pd .Series ([1 ], name = 0 , dtype = pd .Int64Dtype ())
173
+ tm .assert_series_equal (result , expected )
174
+
175
+ df = pd .DataFrame ([1 ], dtype = pd .CategoricalDtype ())
176
+ result = df .append (df .iloc [0 ]).iloc [- 1 ]
177
+ expected = pd .Series ([1 ], name = 0 , dtype = pd .CategoricalDtype ())
178
+ tm .assert_series_equal (result , expected )
179
+
180
+ df = pd .DataFrame ([pd .Interval (left = 0 , right = 5 )], dtype = pd .IntervalDtype ())
181
+ result = df .append (df .iloc [0 ]).iloc [- 1 ]
182
+ expected = pd .Series (
183
+ [pd .Interval (left = 0 , right = 5 )], name = 0 , dtype = pd .IntervalDtype ()
184
+ )
185
+ tm .assert_series_equal (result , expected )
186
+
187
+ df = pd .DataFrame ([pd .Period ("2000-03" , freq = "M" )], dtype = pd .PeriodDtype ("M" ))
188
+ result = df .append (df .iloc [0 ]).iloc [- 1 ]
189
+ expected = pd .Series (
190
+ [pd .Period ("2000-03" , freq = "M" )], name = 0 , dtype = pd .PeriodDtype ("M" )
191
+ )
192
+ tm .assert_series_equal (result , expected )
193
+
194
+ df = pd .DataFrame ([1 ], dtype = pd .SparseDtype ())
195
+ result = df .append (df .iloc [0 ]).iloc [- 1 ]
196
+ expected = pd .Series ([1 ], name = 0 , dtype = pd .SparseDtype ())
197
+ tm .assert_series_equal (result , expected )
198
+
170
199
@pytest .mark .parametrize (
171
200
"timestamp" , ["2019-07-19 07:04:57+0100" , "2019-07-19 07:04:57" ]
172
201
)
0 commit comments