Skip to content

Commit 9612aec

Browse files
[ArrayManager] TST: enable IO tests (#40298)
1 parent 0a2a200 commit 9612aec

25 files changed

+87
-30
lines changed

.github/workflows/ci.yml

+6
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ jobs:
185185
pytest pandas/tests/dtypes/
186186
pytest pandas/tests/generic/
187187
pytest pandas/tests/indexes/
188+
pytest pandas/tests/io/test_* -m "not slow and not clipboard"
189+
pytest pandas/tests/io/excel/ -m "not slow and not clipboard"
190+
pytest pandas/tests/io/formats/ -m "not slow and not clipboard"
191+
pytest pandas/tests/io/parser/ -m "not slow and not clipboard"
192+
pytest pandas/tests/io/sas/ -m "not slow and not clipboard"
193+
pytest pandas/tests/io/xml/ -m "not slow and not clipboard"
188194
pytest pandas/tests/libs/
189195
pytest pandas/tests/plotting/
190196
pytest pandas/tests/scalar/

pandas/tests/io/pytables/test_append.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import pytest
88

99
from pandas._libs.tslibs import Timestamp
10+
import pandas.util._test_decorators as td
1011

1112
import pandas as pd
1213
from pandas import (
@@ -24,7 +25,7 @@
2425
ensure_clean_store,
2526
)
2627

27-
pytestmark = pytest.mark.single
28+
pytestmark = [pytest.mark.single, td.skip_array_manager_not_yet_implemented]
2829

2930

3031
@pytest.mark.filterwarnings("ignore:object name:tables.exceptions.NaturalNameWarning")

pandas/tests/io/pytables/test_categorical.py

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

4+
import pandas.util._test_decorators as td
5+
46
from pandas import (
57
Categorical,
68
DataFrame,
@@ -15,7 +17,7 @@
1517
ensure_clean_store,
1618
)
1719

18-
pytestmark = pytest.mark.single
20+
pytestmark = [pytest.mark.single, td.skip_array_manager_not_yet_implemented]
1921

2022

2123
def test_categorical(setup_path):

pandas/tests/io/pytables/test_compat.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import pytest
22

3+
import pandas.util._test_decorators as td
4+
35
import pandas as pd
46
import pandas._testing as tm
57
from pandas.tests.io.pytables.common import ensure_clean_path
68

79
tables = pytest.importorskip("tables")
810

11+
pytestmark = td.skip_array_manager_not_yet_implemented
12+
913

1014
@pytest.fixture
1115
def pytables_hdf5_file():

pandas/tests/io/pytables/test_errors.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import numpy as np
77
import pytest
88

9+
import pandas.util._test_decorators as td
10+
911
from pandas import (
1012
CategoricalIndex,
1113
DataFrame,
@@ -25,7 +27,7 @@
2527
_maybe_adjust_name,
2628
)
2729

28-
pytestmark = pytest.mark.single
30+
pytestmark = [pytest.mark.single, td.skip_array_manager_not_yet_implemented]
2931

3032

3133
def test_pass_spec_to_storer(setup_path):

pandas/tests/io/pytables/test_file_handling.py

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

66
from pandas.compat import is_platform_little_endian
7+
import pandas.util._test_decorators as td
78

89
from pandas import (
910
DataFrame,
@@ -26,7 +27,7 @@
2627
Term,
2728
)
2829

29-
pytestmark = pytest.mark.single
30+
pytestmark = [pytest.mark.single, td.skip_array_manager_not_yet_implemented]
3031

3132

3233
def test_mode(setup_path):

pandas/tests/io/pytables/test_keys.py

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

3+
import pandas.util._test_decorators as td
4+
35
from pandas import (
46
DataFrame,
57
HDFStore,
@@ -11,7 +13,7 @@
1113
tables,
1214
)
1315

14-
pytestmark = pytest.mark.single
16+
pytestmark = [pytest.mark.single, td.skip_array_manager_not_yet_implemented]
1517

1618

1719
def test_keys(setup_path):

pandas/tests/io/pytables/test_put.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
)
3030
from pandas.util import _test_decorators as td
3131

32-
pytestmark = pytest.mark.single
32+
pytestmark = [pytest.mark.single, td.skip_array_manager_not_yet_implemented]
3333

3434

3535
def test_format_type(setup_path):

pandas/tests/io/pytables/test_pytables_missing.py

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import pandas as pd
66
import pandas._testing as tm
77

8+
pytestmark = td.skip_array_manager_not_yet_implemented
9+
810

911
@td.skip_if_installed("tables")
1012
def test_pytables_raises():

pandas/tests/io/pytables/test_read.py

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

2626
from pandas.io.pytables import TableIterator
2727

28-
pytestmark = pytest.mark.single
28+
pytestmark = [pytest.mark.single, td.skip_array_manager_not_yet_implemented]
2929

3030

3131
def test_read_missing_key_close_store(setup_path):

pandas/tests/io/pytables/test_retain_attributes.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import pytest
44

55
from pandas._libs.tslibs import Timestamp
6+
import pandas.util._test_decorators as td
67

78
from pandas import (
89
DataFrame,
@@ -17,7 +18,7 @@
1718
ensure_clean_store,
1819
)
1920

20-
pytestmark = pytest.mark.single
21+
pytestmark = [pytest.mark.single, td.skip_array_manager_not_yet_implemented]
2122

2223

2324
def test_retain_index_attributes(setup_path):

pandas/tests/io/pytables/test_round_trip.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
_default_compressor = "blosc"
3131

3232

33-
pytestmark = pytest.mark.single
33+
pytestmark = [pytest.mark.single, td.skip_array_manager_not_yet_implemented]
3434

3535

3636
def test_conv_read_write(setup_path):

pandas/tests/io/pytables/test_select.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import pytest
66

77
from pandas._libs.tslibs import Timestamp
8+
import pandas.util._test_decorators as td
89

910
import pandas as pd
1011
from pandas import (
@@ -29,7 +30,7 @@
2930

3031
from pandas.io.pytables import Term
3132

32-
pytestmark = pytest.mark.single
33+
pytestmark = [pytest.mark.single, td.skip_array_manager_not_yet_implemented]
3334

3435

3536
def test_select_columns_in_where(setup_path):

pandas/tests/io/pytables/test_store.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
safe_close,
3333
)
3434

35-
# TODO(ArrayManager) HDFStore relies on accessing the blocks
36-
pytestmark = td.skip_array_manager_not_yet_implemented
37-
38-
3935
_default_compressor = "blosc"
4036
ignore_natural_naming_warning = pytest.mark.filterwarnings(
4137
"ignore:object name:tables.exceptions.NaturalNameWarning"
@@ -46,7 +42,8 @@
4642
read_hdf,
4743
)
4844

49-
pytestmark = pytest.mark.single
45+
# TODO(ArrayManager) HDFStore relies on accessing the blocks
46+
pytestmark = [pytest.mark.single, td.skip_array_manager_not_yet_implemented]
5047

5148

5249
def test_context(setup_path):

pandas/tests/io/pytables/test_subclass.py

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

3+
import pandas.util._test_decorators as td
4+
35
from pandas import (
46
DataFrame,
57
Series,
@@ -12,6 +14,8 @@
1214
read_hdf,
1315
)
1416

17+
pytestmark = td.skip_array_manager_not_yet_implemented
18+
1519

1620
class TestHDFStoreSubclass:
1721
# GH 33748

pandas/tests/io/pytables/test_time_series.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
import numpy as np
44
import pytest
55

6+
import pandas.util._test_decorators as td
7+
68
from pandas import (
79
DataFrame,
810
Series,
911
_testing as tm,
1012
)
1113
from pandas.tests.io.pytables.common import ensure_clean_store
1214

13-
pytestmark = pytest.mark.single
15+
pytestmark = [pytest.mark.single, td.skip_array_manager_not_yet_implemented]
1416

1517

1618
def test_store_datetime_fractional_secs(setup_path):

pandas/tests/io/sas/test_sas7bdat.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,13 @@ def test_compact_numerical_values(datapath):
194194
tm.assert_series_equal(result, expected, check_exact=True)
195195

196196

197-
def test_many_columns(datapath):
197+
def test_many_columns(datapath, using_array_manager):
198198
# Test for looking for column information in more places (PR #22628)
199199
fname = datapath("io", "sas", "data", "many_columns.sas7bdat")
200-
with tm.assert_produces_warning(PerformanceWarning):
200+
expected_warning = None
201+
if not using_array_manager:
202+
expected_warning = PerformanceWarning
203+
with tm.assert_produces_warning(expected_warning):
201204
# Many DataFrame.insert calls
202205
df = pd.read_sas(fname, encoding="latin-1")
203206

pandas/tests/io/test_common.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ def test_write_fspath_all(self, writer_name, writer_kwargs, module):
307307

308308
assert result == expected
309309

310+
@td.skip_array_manager_not_yet_implemented # TODO(ArrayManager) IO HDF5
310311
def test_write_fspath_hdf5(self):
311312
# Same test as write_fspath_all, except HDF5 files aren't
312313
# necessarily byte-for-byte identical for a given dataframe, so we'll
@@ -431,7 +432,10 @@ def test_is_fsspec_url():
431432

432433

433434
@pytest.mark.parametrize("encoding", [None, "utf-8"])
434-
@pytest.mark.parametrize("format", ["csv", "json"])
435+
@pytest.mark.parametrize(
436+
"format",
437+
["csv", pytest.param("json", marks=td.skip_array_manager_not_yet_implemented)],
438+
)
435439
def test_codecs_encoding(encoding, format):
436440
# GH39247
437441
expected = tm.makeDataFrame()

pandas/tests/io/test_fsspec.py

+2
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ def test_arrowparquet_options(fsspectest):
166166
assert fsspectest.test[0] == "parquet_read"
167167

168168

169+
@td.skip_array_manager_not_yet_implemented # TODO(ArrayManager) fastparquet
169170
@td.skip_if_no("fastparquet")
170171
def test_fastparquet_options(fsspectest):
171172
"""Regression test for writing to a not-yet-existent GCS Parquet file."""
@@ -210,6 +211,7 @@ def test_s3_protocols(s3_resource, tips_file, protocol, s3so):
210211
)
211212

212213

214+
@td.skip_array_manager_not_yet_implemented # TODO(ArrayManager) fastparquet
213215
@td.skip_if_no("s3fs")
214216
@td.skip_if_no("fastparquet")
215217
def test_s3_parquet(s3_resource, s3so):

pandas/tests/io/test_gcs.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@ def ls(self, path, **kwargs):
4444

4545

4646
@td.skip_if_no("gcsfs")
47-
@pytest.mark.parametrize("format", ["csv", "json", "parquet", "excel", "markdown"])
47+
@pytest.mark.parametrize(
48+
"format",
49+
[
50+
"csv",
51+
pytest.param("json", marks=td.skip_array_manager_not_yet_implemented),
52+
"parquet",
53+
"excel",
54+
"markdown",
55+
],
56+
)
4857
def test_to_read_gcs(gcs_buffer, format):
4958
"""
5059
Test that many to/read functions support GCS.

pandas/tests/io/test_parquet.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@
4141
_HAVE_FASTPARQUET = False
4242

4343

44-
pytestmark = pytest.mark.filterwarnings(
45-
"ignore:RangeIndex.* is deprecated:DeprecationWarning"
46-
)
44+
pytestmark = [
45+
pytest.mark.filterwarnings("ignore:RangeIndex.* is deprecated:DeprecationWarning"),
46+
# TODO(ArrayManager) fastparquet / pyarrow rely on BlockManager internals
47+
td.skip_array_manager_not_yet_implemented,
48+
]
4749

4850

4951
# setup engines & skips

pandas/tests/io/test_pickle.py

+4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
lzma = import_lzma()
5555

5656

57+
# TODO(ArrayManager) pickling
58+
pytestmark = td.skip_array_manager_not_yet_implemented
59+
60+
5761
@pytest.fixture(scope="module")
5862
def current_pickle_data():
5963
# our current version pickle data

pandas/tests/io/test_stata.py

-5
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
import numpy as np
1313
import pytest
1414

15-
import pandas.util._test_decorators as td
16-
1715
from pandas.core.dtypes.common import is_categorical_dtype
1816

1917
import pandas as pd
@@ -35,9 +33,6 @@
3533
read_stata,
3634
)
3735

38-
# TODO(ArrayManager) the stata code relies on BlockManager internals (eg blknos)
39-
pytestmark = td.skip_array_manager_not_yet_implemented
40-
4136

4237
@pytest.fixture()
4338
def mixed_frame():

pandas/tests/io/test_user_agent.py

+14-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,13 @@ def do_GET(self):
189189
marks=td.skip_array_manager_not_yet_implemented,
190190
),
191191
(ParquetPyArrowUserAgentResponder, pd.read_parquet, "pyarrow"),
192-
(ParquetFastParquetUserAgentResponder, pd.read_parquet, "fastparquet"),
192+
pytest.param(
193+
ParquetFastParquetUserAgentResponder,
194+
pd.read_parquet,
195+
"fastparquet",
196+
# TODO(ArrayManager) fastparquet
197+
marks=td.skip_array_manager_not_yet_implemented,
198+
),
193199
(PickleUserAgentResponder, pd.read_pickle, None),
194200
(StataUserAgentResponder, pd.read_stata, None),
195201
(GzippedCSVUserAgentResponder, pd.read_csv, None),
@@ -234,7 +240,13 @@ def test_server_and_default_headers(responder, read_method, parquet_engine):
234240
marks=td.skip_array_manager_not_yet_implemented,
235241
),
236242
(ParquetPyArrowUserAgentResponder, pd.read_parquet, "pyarrow"),
237-
(ParquetFastParquetUserAgentResponder, pd.read_parquet, "fastparquet"),
243+
pytest.param(
244+
ParquetFastParquetUserAgentResponder,
245+
pd.read_parquet,
246+
"fastparquet",
247+
# TODO(ArrayManager) fastparquet
248+
marks=td.skip_array_manager_not_yet_implemented,
249+
),
238250
(PickleUserAgentResponder, pd.read_pickle, None),
239251
(StataUserAgentResponder, pd.read_stata, None),
240252
(GzippedCSVUserAgentResponder, pd.read_csv, None),

pandas/tests/io/xml/test_to_xml.py

+1
Original file line numberDiff line numberDiff line change
@@ -1172,6 +1172,7 @@ def test_style_to_string():
11721172
assert out_xml == out_str
11731173

11741174

1175+
@td.skip_array_manager_not_yet_implemented # TODO(ArrayManager) JSON
11751176
@td.skip_if_no("lxml")
11761177
def test_style_to_json():
11771178
xsl = """\

0 commit comments

Comments
 (0)