diff --git a/ci/deps/actions-310.yaml b/ci/deps/actions-310.yaml index 9829380620f86..bbc468f9d8f43 100644 --- a/ci/deps/actions-310.yaml +++ b/ci/deps/actions-310.yaml @@ -2,7 +2,7 @@ name: pandas-dev channels: - conda-forge dependencies: - - python=3.9 + - python=3.10 # test dependencies - cython=0.29.24 diff --git a/pandas/tests/io/test_fsspec.py b/pandas/tests/io/test_fsspec.py index f1040c0bd30f2..172065755d4b7 100644 --- a/pandas/tests/io/test_fsspec.py +++ b/pandas/tests/io/test_fsspec.py @@ -3,6 +3,7 @@ import numpy as np import pytest +from pandas.compat import PY310 from pandas.compat._optional import VERSIONS from pandas import ( @@ -181,6 +182,7 @@ def test_arrowparquet_options(fsspectest): @td.skip_array_manager_not_yet_implemented # TODO(ArrayManager) fastparquet @td.skip_if_no("fastparquet") +@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10") def test_fastparquet_options(fsspectest): """Regression test for writing to a not-yet-existent GCS Parquet file.""" df = DataFrame({"a": [0]}) diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index 2eb8738d88b41..a1a39a1cf8881 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -13,7 +13,10 @@ from pandas._config import get_option -from pandas.compat import is_platform_windows +from pandas.compat import ( + PY310, + is_platform_windows, +) from pandas.compat.pyarrow import ( pa_version_under2p0, pa_version_under5p0, @@ -262,6 +265,7 @@ def test_options_py(df_compat, pa): check_round_trip(df_compat) +@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10") def test_options_fp(df_compat, fp): # use the set option @@ -339,6 +343,7 @@ def test_get_engine_auto_error_message(): get_engine("auto") +@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10") def test_cross_engine_pa_fp(df_cross_compat, pa, fp): # cross-compat with differing reading/writing engines @@ -404,7 +409,11 @@ def test_error(self, engine): msg = "to_parquet only supports IO with DataFrames" self.check_error_on_write(obj, engine, ValueError, msg) - def test_columns_dtypes(self, engine): + def test_columns_dtypes(self, request, engine): + if PY310 and engine == "fastparquet": + request.node.add_marker( + pytest.mark.xfail(reason="fastparquet failing on 3.10") + ) df = pd.DataFrame({"string": list("abc"), "int": list(range(1, 4))}) # unicode @@ -431,7 +440,7 @@ def test_columns_dtypes_invalid(self, engine): self.check_error_on_write(df, engine, ValueError, msg) @pytest.mark.parametrize("compression", [None, "gzip", "snappy", "brotli"]) - def test_compression(self, engine, compression): + def test_compression(self, engine, compression, request): if compression == "snappy": pytest.importorskip("snappy") @@ -439,11 +448,19 @@ def test_compression(self, engine, compression): elif compression == "brotli": pytest.importorskip("brotli") + if PY310 and engine == "fastparquet": + request.node.add_marker( + pytest.mark.xfail(reason="fastparquet failing on 3.10") + ) df = pd.DataFrame({"A": [1, 2, 3]}) check_round_trip(df, engine, write_kwargs={"compression": compression}) - def test_read_columns(self, engine): + def test_read_columns(self, engine, request): # GH18154 + if PY310 and engine == "fastparquet": + request.node.add_marker( + pytest.mark.xfail(reason="fastparquet failing on 3.10") + ) df = pd.DataFrame({"string": list("abc"), "int": list(range(1, 4))}) expected = pd.DataFrame({"string": list("abc")}) @@ -451,7 +468,11 @@ def test_read_columns(self, engine): df, engine, expected=expected, read_kwargs={"columns": ["string"]} ) - def test_write_index(self, engine): + def test_write_index(self, engine, request): + if PY310 and engine == "fastparquet": + request.node.add_marker( + pytest.mark.xfail(reason="fastparquet failing on 3.10") + ) check_names = engine != "fastparquet" df = pd.DataFrame({"A": [1, 2, 3]}) @@ -500,9 +521,13 @@ def test_multiindex_with_columns(self, pa): df, engine, read_kwargs={"columns": ["A", "B"]}, expected=df[["A", "B"]] ) - def test_write_ignoring_index(self, engine): + def test_write_ignoring_index(self, engine, request): # ENH 20768 # Ensure index=False omits the index from the written Parquet file. + if PY310 and engine == "fastparquet": + request.node.add_marker( + pytest.mark.xfail(reason="fastparquet failing on 3.10") + ) df = pd.DataFrame({"a": [1, 2, 3], "b": ["q", "r", "s"]}) write_kwargs = {"compression": None, "index": False} @@ -986,6 +1011,7 @@ def test_read_parquet_manager(self, pa, using_array_manager): class TestParquetFastParquet(Base): + @pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10") def test_basic(self, fp, df_full): df = df_full @@ -1003,6 +1029,7 @@ def test_duplicate_columns(self, fp): msg = "Cannot create parquet dataset with duplicate column names" self.check_error_on_write(df, fp, ValueError, msg) + @pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10") def test_bool_with_none(self, fp): df = pd.DataFrame({"a": [True, None, False]}) expected = pd.DataFrame({"a": [1.0, np.nan, 0.0]}, dtype="float16") @@ -1022,10 +1049,12 @@ def test_unsupported(self, fp): msg = "Can't infer object conversion type" self.check_error_on_write(df, fp, ValueError, msg) + @pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10") def test_categorical(self, fp): df = pd.DataFrame({"a": pd.Categorical(list("abc"))}) check_round_trip(df, fp) + @pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10") def test_filter_row_groups(self, fp): d = {"a": list(range(0, 3))} df = pd.DataFrame(d) @@ -1044,6 +1073,7 @@ def test_s3_roundtrip(self, df_compat, s3_resource, fp, s3so): write_kwargs={"compression": None, "storage_options": s3so}, ) + @pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10") def test_partition_cols_supported(self, fp, df_full): # GH #23283 partition_cols = ["bool", "int"] @@ -1061,6 +1091,7 @@ def test_partition_cols_supported(self, fp, df_full): actual_partition_cols = fastparquet.ParquetFile(path, False).cats assert len(actual_partition_cols) == 2 + @pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10") def test_partition_cols_string(self, fp, df_full): # GH #27117 partition_cols = "bool" @@ -1078,6 +1109,7 @@ def test_partition_cols_string(self, fp, df_full): actual_partition_cols = fastparquet.ParquetFile(path, False).cats assert len(actual_partition_cols) == 1 + @pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10") def test_partition_on_supported(self, fp, df_full): # GH #23283 partition_cols = ["bool", "int"] @@ -1113,6 +1145,7 @@ def test_error_on_using_partition_cols_and_partition_on(self, fp, df_full): partition_cols=partition_cols, ) + @pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10") def test_empty_dataframe(self, fp): # GH #27339 df = pd.DataFrame() @@ -1120,6 +1153,7 @@ def test_empty_dataframe(self, fp): expected.index.name = "index" check_round_trip(df, fp, expected=expected) + @pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10") def test_timezone_aware_index(self, fp, timezone_aware_date_list): idx = 5 * [timezone_aware_date_list] diff --git a/pandas/tests/io/test_user_agent.py b/pandas/tests/io/test_user_agent.py index fb6128bd514f9..3d4c157e5f09e 100644 --- a/pandas/tests/io/test_user_agent.py +++ b/pandas/tests/io/test_user_agent.py @@ -11,6 +11,7 @@ import pytest +from pandas.compat import PY310 import pandas.util._test_decorators as td import pandas as pd @@ -241,7 +242,10 @@ def responder(request): pd.read_parquet, "fastparquet", # TODO(ArrayManager) fastparquet - marks=td.skip_array_manager_not_yet_implemented, + marks=[ + td.skip_array_manager_not_yet_implemented, + pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10"), + ], ), (PickleUserAgentResponder, pd.read_pickle, None), (StataUserAgentResponder, pd.read_stata, None), @@ -276,7 +280,10 @@ def test_server_and_default_headers(responder, read_method, parquet_engine): pd.read_parquet, "fastparquet", # TODO(ArrayManager) fastparquet - marks=td.skip_array_manager_not_yet_implemented, + marks=[ + td.skip_array_manager_not_yet_implemented, + pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10"), + ], ), (PickleUserAgentResponder, pd.read_pickle, None), (StataUserAgentResponder, pd.read_stata, None),