11import numpy as np
22import pytest
33
4- import pandas .util ._test_decorators as td
5-
64import pandas as pd
75from pandas import (
86 DataFrame ,
1311)
1412import pandas ._testing as tm
1513
16- # TODO td.skip_array_manager_not_yet_implemented
17- # appending with reindexing not yet working
18-
1914
2015class TestDataFrameAppend :
2116 def test_append_multiindex (self , multiindex_dataframe_random_data , frame_or_series ):
@@ -43,7 +38,6 @@ def test_append_empty_list(self):
4338 tm .assert_frame_equal (result , expected )
4439 assert result is not df # .append() should return a new object
4540
46- @td .skip_array_manager_not_yet_implemented
4741 def test_append_series_dict (self ):
4842 df = DataFrame (np .random .randn (5 , 4 ), columns = ["foo" , "bar" , "baz" , "qux" ])
4943
@@ -84,7 +78,6 @@ def test_append_series_dict(self):
8478 expected = df .append (df [- 1 :], ignore_index = True )
8579 tm .assert_frame_equal (result , expected )
8680
87- @td .skip_array_manager_not_yet_implemented
8881 def test_append_list_of_series_dicts (self ):
8982 df = DataFrame (np .random .randn (5 , 4 ), columns = ["foo" , "bar" , "baz" , "qux" ])
9083
@@ -103,7 +96,6 @@ def test_append_list_of_series_dicts(self):
10396 expected = df .append (DataFrame (dicts ), ignore_index = True , sort = True )
10497 tm .assert_frame_equal (result , expected )
10598
106- @td .skip_array_manager_not_yet_implemented
10799 def test_append_missing_cols (self ):
108100 # GH22252
109101 # exercise the conditional branch in append method where the data
@@ -148,8 +140,7 @@ def test_append_empty_dataframe(self):
148140 expected = df1 .copy ()
149141 tm .assert_frame_equal (result , expected )
150142
151- @td .skip_array_manager_not_yet_implemented
152- def test_append_dtypes (self ):
143+ def test_append_dtypes (self , using_array_manager ):
153144
154145 # GH 5754
155146 # row appends of different dtypes (so need to do by-item)
@@ -173,6 +164,10 @@ def test_append_dtypes(self):
173164 expected = DataFrame (
174165 {"bar" : Series ([Timestamp ("20130101" ), np .nan ], dtype = "M8[ns]" )}
175166 )
167+ if using_array_manager :
168+ # TODO(ArrayManager) decide on exact casting rules in concat
169+ # With ArrayManager, all-NaN float is not ignored
170+ expected = expected .astype (object )
176171 tm .assert_frame_equal (result , expected )
177172
178173 df1 = DataFrame ({"bar" : Timestamp ("20130101" )}, index = range (1 ))
@@ -181,6 +176,9 @@ def test_append_dtypes(self):
181176 expected = DataFrame (
182177 {"bar" : Series ([Timestamp ("20130101" ), np .nan ], dtype = "M8[ns]" )}
183178 )
179+ if using_array_manager :
180+ # With ArrayManager, all-NaN float is not ignored
181+ expected = expected .astype (object )
184182 tm .assert_frame_equal (result , expected )
185183
186184 df1 = DataFrame ({"bar" : np .nan }, index = range (1 ))
@@ -189,6 +187,9 @@ def test_append_dtypes(self):
189187 expected = DataFrame (
190188 {"bar" : Series ([np .nan , Timestamp ("20130101" )], dtype = "M8[ns]" )}
191189 )
190+ if using_array_manager :
191+ # With ArrayManager, all-NaN float is not ignored
192+ expected = expected .astype (object )
192193 tm .assert_frame_equal (result , expected )
193194
194195 df1 = DataFrame ({"bar" : Timestamp ("20130101" )}, index = range (1 ))
@@ -208,7 +209,6 @@ def test_append_timestamps_aware_or_naive(self, tz_naive_fixture, timestamp):
208209 expected = Series (Timestamp (timestamp , tz = tz ), name = 0 )
209210 tm .assert_series_equal (result , expected )
210211
211- @td .skip_array_manager_not_yet_implemented
212212 @pytest .mark .parametrize (
213213 "data, dtype" ,
214214 [
0 commit comments