Skip to content

Commit 8e5b749

Browse files
mroeschkecbpygit
authored andcommitted
TST: Remove arraymanager markers (pandas-dev#56626)
1 parent c5d1e6c commit 8e5b749

35 files changed

+2
-134
lines changed

pandas/tests/copy_view/test_astype.py

-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import pytest
55

66
from pandas.compat.pyarrow import pa_version_under12p0
7-
import pandas.util._test_decorators as td
87

98
import pandas as pd
109
from pandas import (
@@ -88,7 +87,6 @@ def test_astype_different_target_dtype(using_copy_on_write, dtype):
8887
tm.assert_frame_equal(df2, df_orig.astype(dtype))
8988

9089

91-
@td.skip_array_manager_invalid_test
9290
def test_astype_numpy_to_ea():
9391
ser = Series([1, 2, 3])
9492
with pd.option_context("mode.copy_on_write", True):

pandas/tests/copy_view/test_internals.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import numpy as np
22
import pytest
33

4-
import pandas.util._test_decorators as td
5-
64
import pandas as pd
75
from pandas import DataFrame
86
import pandas._testing as tm
97
from pandas.tests.copy_view.util import get_array
108

119

12-
@td.skip_array_manager_invalid_test
1310
def test_consolidate(using_copy_on_write):
1411
# create unconsolidated DataFrame
1512
df = DataFrame({"a": [1, 2, 3], "b": [0.1, 0.2, 0.3]})
@@ -46,7 +43,6 @@ def test_consolidate(using_copy_on_write):
4643

4744

4845
@pytest.mark.single_cpu
49-
@td.skip_array_manager_invalid_test
5046
def test_switch_options():
5147
# ensure we can switch the value of the option within one session
5248
# (assuming data is constructed after switching)
@@ -75,7 +71,6 @@ def test_switch_options():
7571
assert df.iloc[0, 0] == 0
7672

7773

78-
@td.skip_array_manager_invalid_test
7974
@pytest.mark.parametrize("dtype", [np.intp, np.int8])
8075
@pytest.mark.parametrize(
8176
"locs, arr",

pandas/tests/frame/indexing/test_indexing.py

-5
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
PerformanceWarning,
1616
SettingWithCopyError,
1717
)
18-
import pandas.util._test_decorators as td
1918

2019
from pandas.core.dtypes.common import is_integer
2120

@@ -574,7 +573,6 @@ def test_getitem_setitem_integer_slice_keyerrors(self):
574573
with pytest.raises(KeyError, match=r"^3$"):
575574
df2.loc[3:11] = 0
576575

577-
@td.skip_array_manager_invalid_test # already covered in test_iloc_col_slice_view
578576
def test_fancy_getitem_slice_mixed(
579577
self, float_frame, float_string_frame, using_copy_on_write, warn_copy_on_write
580578
):
@@ -640,7 +638,6 @@ def test_getitem_fancy_scalar(self, float_frame):
640638
for idx in f.index[::5]:
641639
assert ix[idx, col] == ts[idx]
642640

643-
@td.skip_array_manager_invalid_test # TODO(ArrayManager) rewrite not using .values
644641
def test_setitem_fancy_scalar(self, float_frame):
645642
f = float_frame
646643
expected = float_frame.copy()
@@ -680,7 +677,6 @@ def test_getitem_fancy_boolean(self, float_frame):
680677
expected = f.reindex(index=f.index[boolvec], columns=["C", "D"])
681678
tm.assert_frame_equal(result, expected)
682679

683-
@td.skip_array_manager_invalid_test # TODO(ArrayManager) rewrite not using .values
684680
def test_setitem_fancy_boolean(self, float_frame):
685681
# from 2d, set with booleans
686682
frame = float_frame.copy()
@@ -1404,7 +1400,6 @@ def test_loc_setitem_rhs_frame(self, idxr, val, warn):
14041400
expected = DataFrame({"a": [np.nan, val]})
14051401
tm.assert_frame_equal(df, expected)
14061402

1407-
@td.skip_array_manager_invalid_test
14081403
def test_iloc_setitem_enlarge_no_warning(self, warn_copy_on_write):
14091404
# GH#47381
14101405
df = DataFrame(columns=["a", "b"])

pandas/tests/frame/indexing/test_setitem.py

-6
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import numpy as np
44
import pytest
55

6-
import pandas.util._test_decorators as td
7-
86
from pandas.core.dtypes.base import _registry as ea_registry
97
from pandas.core.dtypes.common import is_object_dtype
108
from pandas.core.dtypes.dtypes import (
@@ -704,8 +702,6 @@ def test_setitem_ea_dtype_rhs_series(self):
704702
expected = DataFrame({"a": [1, 2]}, dtype="Int64")
705703
tm.assert_frame_equal(df, expected)
706704

707-
# TODO(ArrayManager) set column with 2d column array, see #44788
708-
@td.skip_array_manager_not_yet_implemented
709705
def test_setitem_npmatrix_2d(self):
710706
# GH#42376
711707
# for use-case df["x"] = sparse.random((10, 10)).mean(axis=1)
@@ -1063,7 +1059,6 @@ def inc(x):
10631059

10641060

10651061
class TestDataFrameSetItemBooleanMask:
1066-
@td.skip_array_manager_invalid_test # TODO(ArrayManager) rewrite not using .values
10671062
@pytest.mark.parametrize(
10681063
"mask_type",
10691064
[lambda df: df > np.abs(df) / 2, lambda df: (df > np.abs(df) / 2).values],
@@ -1307,7 +1302,6 @@ def test_setitem_not_operating_inplace(self, value, set_value, indexer):
13071302
df[indexer] = set_value
13081303
tm.assert_frame_equal(view, expected)
13091304

1310-
@td.skip_array_manager_invalid_test
13111305
def test_setitem_column_update_inplace(
13121306
self, using_copy_on_write, warn_copy_on_write
13131307
):

pandas/tests/frame/methods/test_copy.py

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ def test_copy(self, float_frame, float_string_frame):
4646
copy = float_string_frame.copy()
4747
assert copy._mgr is not float_string_frame._mgr
4848

49-
@td.skip_array_manager_invalid_test
5049
def test_copy_consolidates(self):
5150
# GH#42477
5251
df = DataFrame(

pandas/tests/frame/methods/test_fillna.py

-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
from pandas._config import using_pyarrow_string_dtype
55

6-
import pandas.util._test_decorators as td
7-
86
from pandas import (
97
Categorical,
108
DataFrame,
@@ -49,7 +47,6 @@ def test_fillna_dict_inplace_nonunique_columns(
4947
if not using_copy_on_write:
5048
assert tm.shares_memory(df.iloc[:, 2], orig.iloc[:, 2])
5149

52-
@td.skip_array_manager_not_yet_implemented
5350
def test_fillna_on_column_view(self, using_copy_on_write):
5451
# GH#46149 avoid unnecessary copies
5552
arr = np.full((40, 50), np.nan)
@@ -752,7 +749,6 @@ def test_fillna_inplace_with_columns_limit_and_value(self):
752749
df.fillna(axis=1, value=100, limit=1, inplace=True)
753750
tm.assert_frame_equal(df, expected)
754751

755-
@td.skip_array_manager_invalid_test
756752
@pytest.mark.parametrize("val", [-1, {"x": -1, "y": -1}])
757753
def test_inplace_dict_update_view(
758754
self, val, using_copy_on_write, warn_copy_on_write

pandas/tests/frame/methods/test_interpolate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def test_interp_string_axis(self, axis_name, axis_number):
470470

471471
@pytest.mark.parametrize("multiblock", [True, False])
472472
@pytest.mark.parametrize("method", ["ffill", "bfill", "pad"])
473-
def test_interp_fillna_methods(self, request, axis, multiblock, method):
473+
def test_interp_fillna_methods(self, axis, multiblock, method):
474474
# GH 12918
475475
df = DataFrame(
476476
{

pandas/tests/frame/methods/test_is_homogeneous_dtype.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import numpy as np
22
import pytest
33

4-
import pandas.util._test_decorators as td
5-
64
from pandas import (
75
Categorical,
86
DataFrame,
97
)
108

11-
# _is_homogeneous_type always returns True for ArrayManager
12-
pytestmark = td.skip_array_manager_invalid_test
13-
149

1510
@pytest.mark.parametrize(
1611
"data, expected",

pandas/tests/frame/methods/test_reindex.py

-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
is_platform_windows,
1414
)
1515
from pandas.compat.numpy import np_version_gt2
16-
import pandas.util._test_decorators as td
1716

1817
import pandas as pd
1918
from pandas import (
@@ -136,7 +135,6 @@ class TestDataFrameSelectReindex:
136135
reason="Passes int32 values to DatetimeArray in make_na_array on "
137136
"windows, 32bit linux builds",
138137
)
139-
@td.skip_array_manager_not_yet_implemented
140138
def test_reindex_tzaware_fill_value(self):
141139
# GH#52586
142140
df = DataFrame([[1]])
@@ -198,7 +196,6 @@ def test_reindex_copies_ea(self, using_copy_on_write):
198196
else:
199197
assert not np.shares_memory(result2[0].array._data, df[0].array._data)
200198

201-
@td.skip_array_manager_not_yet_implemented
202199
def test_reindex_date_fill_value(self):
203200
# passing date to dt64 is deprecated; enforced in 2.0 to cast to object
204201
arr = date_range("2016-01-01", periods=6).values.reshape(3, 2)

pandas/tests/frame/methods/test_shift.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import numpy as np
22
import pytest
33

4-
import pandas.util._test_decorators as td
5-
64
import pandas as pd
75
from pandas import (
86
CategoricalIndex,
@@ -464,7 +462,6 @@ def test_shift_axis1_multiple_blocks(self):
464462

465463
tm.assert_frame_equal(result, expected)
466464

467-
@td.skip_array_manager_not_yet_implemented # TODO(ArrayManager) axis=1 support
468465
def test_shift_axis1_multiple_blocks_with_int_fill(self):
469466
# GH#42719
470467
rng = np.random.default_rng(2)

pandas/tests/frame/methods/test_to_dict_of_blocks.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
import numpy as np
22
import pytest
33

4-
import pandas.util._test_decorators as td
5-
64
from pandas import (
75
DataFrame,
86
MultiIndex,
97
)
108
import pandas._testing as tm
119
from pandas.core.arrays import NumpyExtensionArray
1210

13-
pytestmark = td.skip_array_manager_invalid_test
14-
1511

1612
class TestToDictOfBlocks:
1713
@pytest.mark.filterwarnings("ignore:Setting a value on a view:FutureWarning")

pandas/tests/frame/methods/test_to_numpy.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import numpy as np
22

3-
import pandas.util._test_decorators as td
4-
53
from pandas import (
64
DataFrame,
75
Timestamp,
@@ -22,7 +20,6 @@ def test_to_numpy_dtype(self):
2220
result = df.to_numpy(dtype="int64")
2321
tm.assert_numpy_array_equal(result, expected)
2422

25-
@td.skip_array_manager_invalid_test
2623
def test_to_numpy_copy(self, using_copy_on_write):
2724
arr = np.random.default_rng(2).standard_normal((4, 3))
2825
df = DataFrame(arr)

pandas/tests/frame/methods/test_transpose.py

-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import numpy as np
22
import pytest
33

4-
import pandas.util._test_decorators as td
5-
64
from pandas import (
75
DataFrame,
86
DatetimeIndex,
@@ -126,7 +124,6 @@ def test_transpose_mixed(self):
126124
for col, s in mixed_T.items():
127125
assert s.dtype == np.object_
128126

129-
@td.skip_array_manager_invalid_test
130127
def test_transpose_get_view(self, float_frame, using_copy_on_write):
131128
dft = float_frame.T
132129
dft.iloc[:, 5:10] = 5
@@ -136,7 +133,6 @@ def test_transpose_get_view(self, float_frame, using_copy_on_write):
136133
else:
137134
assert (float_frame.values[5:10] == 5).all()
138135

139-
@td.skip_array_manager_invalid_test
140136
def test_transpose_get_view_dt64tzget_view(self, using_copy_on_write):
141137
dti = date_range("2016-01-01", periods=6, tz="US/Pacific")
142138
arr = dti._data.reshape(3, 2)

pandas/tests/frame/methods/test_update.py

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import numpy as np
22
import pytest
33

4-
import pandas.util._test_decorators as td
5-
64
import pandas as pd
75
from pandas import (
86
DataFrame,
@@ -175,7 +173,6 @@ def test_update_with_different_dtype(self, using_copy_on_write):
175173
)
176174
tm.assert_frame_equal(df, expected)
177175

178-
@td.skip_array_manager_invalid_test
179176
def test_update_modify_view(
180177
self, using_copy_on_write, warn_copy_on_write, using_infer_string
181178
):

pandas/tests/frame/methods/test_values.py

-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import numpy as np
22
import pytest
33

4-
import pandas.util._test_decorators as td
5-
64
from pandas import (
75
DataFrame,
86
NaT,
@@ -15,7 +13,6 @@
1513

1614

1715
class TestDataFrameValues:
18-
@td.skip_array_manager_invalid_test
1916
def test_values(self, float_frame, using_copy_on_write):
2017
if using_copy_on_write:
2118
with pytest.raises(ValueError, match="read-only"):
@@ -231,7 +228,6 @@ def test_values_lcd(self, mixed_float_frame, mixed_int_frame):
231228

232229

233230
class TestPrivateValues:
234-
@td.skip_array_manager_invalid_test
235231
def test_private_values_dt64tz(self, using_copy_on_write):
236232
dta = date_range("2000", periods=4, tz="US/Central")._data.reshape(-1, 1)
237233

@@ -249,7 +245,6 @@ def test_private_values_dt64tz(self, using_copy_on_write):
249245
df2 = df - df
250246
tm.assert_equal(df2._values, tda)
251247

252-
@td.skip_array_manager_invalid_test
253248
def test_private_values_dt64tz_multicol(self, using_copy_on_write):
254249
dta = date_range("2000", periods=8, tz="US/Central")._data.reshape(-1, 2)
255250

pandas/tests/frame/test_arithmetic.py

-2
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,6 @@ def test_df_arith_2d_array_rowlike_broadcasts(
896896
):
897897
# GH#23000
898898
opname = all_arithmetic_operators
899-
900899
arr = np.arange(6).reshape(3, 2)
901900
df = DataFrame(arr, columns=[True, False], index=["A", "B", "C"])
902901

@@ -919,7 +918,6 @@ def test_df_arith_2d_array_collike_broadcasts(
919918
):
920919
# GH#23000
921920
opname = all_arithmetic_operators
922-
923921
arr = np.arange(6).reshape(3, 2)
924922
df = DataFrame(arr, columns=[True, False], index=["A", "B", "C"])
925923

pandas/tests/frame/test_block_internals.py

-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import pytest
99

1010
from pandas.errors import PerformanceWarning
11-
import pandas.util._test_decorators as td
1211

1312
import pandas as pd
1413
from pandas import (
@@ -26,11 +25,6 @@
2625
# structure
2726

2827

29-
# TODO(ArrayManager) check which of those tests need to be rewritten to test the
30-
# equivalent for ArrayManager
31-
pytestmark = td.skip_array_manager_invalid_test
32-
33-
3428
class TestDataFrameBlockInternals:
3529
def test_setitem_invalidates_datetime_index_freq(self):
3630
# GH#24096 altering a datetime64tz column inplace invalidates the

pandas/tests/frame/test_constructors.py

-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
from pandas._libs import lib
2727
from pandas.errors import IntCastingNaNError
28-
import pandas.util._test_decorators as td
2928

3029
from pandas.core.dtypes.common import is_integer_dtype
3130
from pandas.core.dtypes.dtypes import (
@@ -324,15 +323,13 @@ def test_constructor_dtype_nocast_view_2d_array(
324323
df2 = DataFrame(df.values, dtype=df[0].dtype)
325324
assert df2._mgr.arrays[0].flags.c_contiguous
326325

327-
@td.skip_array_manager_invalid_test
328326
@pytest.mark.xfail(using_pyarrow_string_dtype(), reason="conversion copies")
329327
def test_1d_object_array_does_not_copy(self):
330328
# https://github.com/pandas-dev/pandas/issues/39272
331329
arr = np.array(["a", "b"], dtype="object")
332330
df = DataFrame(arr, copy=False)
333331
assert np.shares_memory(df.values, arr)
334332

335-
@td.skip_array_manager_invalid_test
336333
@pytest.mark.xfail(using_pyarrow_string_dtype(), reason="conversion copies")
337334
def test_2d_object_array_does_not_copy(self):
338335
# https://github.com/pandas-dev/pandas/issues/39272
@@ -2489,7 +2486,6 @@ def test_constructor_list_str_na(self, string_dtype):
24892486
@pytest.mark.parametrize("copy", [False, True])
24902487
def test_dict_nocopy(
24912488
self,
2492-
request,
24932489
copy,
24942490
any_numeric_ea_dtype,
24952491
any_numpy_dtype,

0 commit comments

Comments
 (0)