Skip to content

Commit c365dfc

Browse files
WillAydjorisvandenbossche
authored andcommitted
CI: update fastparquet xfails for new release (pandas-dev#60337)
(cherry picked from commit 34c080c)
1 parent 7958d6c commit c365dfc

File tree

3 files changed

+39
-16
lines changed

3 files changed

+39
-16
lines changed

pandas/tests/io/test_fsspec.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
from pandas._config import using_string_dtype
77

8+
from pandas.compat import HAS_PYARROW
9+
810
from pandas import (
911
DataFrame,
1012
date_range,
@@ -168,7 +170,9 @@ def test_excel_options(fsspectest):
168170
assert fsspectest.test[0] == "read"
169171

170172

171-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string) fastparquet")
173+
@pytest.mark.xfail(
174+
using_string_dtype() and HAS_PYARROW, reason="TODO(infer_string) fastparquet"
175+
)
172176
def test_to_parquet_new_file(cleared_fs, df1):
173177
"""Regression test for writing to a not-yet-existent GCS Parquet file."""
174178
pytest.importorskip("fastparquet")

pandas/tests/io/test_gcs.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import numpy as np
88
import pytest
99

10-
from pandas._config import using_string_dtype
11-
1210
from pandas.compat.pyarrow import pa_version_under17p0
1311

1412
from pandas import (
@@ -196,7 +194,6 @@ def test_to_csv_compression_encoding_gcs(
196194
tm.assert_frame_equal(df, read_df)
197195

198196

199-
@pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string) fastparquet")
200197
def test_to_parquet_gcs_new_file(monkeypatch, tmpdir):
201198
"""Regression test for writing to a not-yet-existent GCS Parquet file."""
202199
pytest.importorskip("fastparquet")

pandas/tests/io/test_parquet.py

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,16 @@ def test_infer_string_large_string_type(self, tmp_path, pa):
11871187

11881188

11891189
class TestParquetFastParquet(Base):
1190-
def test_basic(self, fp, df_full):
1190+
def test_basic(self, fp, df_full, request):
1191+
import fastparquet
1192+
1193+
if Version(fastparquet.__version__) < Version("2024.11.0"):
1194+
request.applymarker(
1195+
pytest.mark.xfail(
1196+
reason=("datetime_with_nat gets incorrect values"),
1197+
)
1198+
)
1199+
11911200
df = df_full
11921201

11931202
dti = pd.date_range("20130101", periods=3, tz="US/Eastern")
@@ -1223,11 +1232,17 @@ def test_duplicate_columns(self, fp):
12231232
msg = "Cannot create parquet dataset with duplicate column names"
12241233
self.check_error_on_write(df, fp, ValueError, msg)
12251234

1226-
@pytest.mark.xfail(
1227-
Version(np.__version__) >= Version("2.0.0"),
1228-
reason="fastparquet uses np.float_ in numpy2",
1229-
)
1230-
def test_bool_with_none(self, fp):
1235+
def test_bool_with_none(self, fp, request):
1236+
import fastparquet
1237+
1238+
if Version(fastparquet.__version__) < Version("2024.11.0") and Version(
1239+
np.__version__
1240+
) >= Version("2.0.0"):
1241+
request.applymarker(
1242+
pytest.mark.xfail(
1243+
reason=("fastparquet uses np.float_ in numpy2"),
1244+
)
1245+
)
12311246
df = pd.DataFrame({"a": [True, None, False]})
12321247
expected = pd.DataFrame({"a": [1.0, np.nan, 0.0]}, dtype="float16")
12331248
# Fastparquet bug in 0.7.1 makes it so that this dtype becomes
@@ -1342,12 +1357,19 @@ def test_empty_dataframe(self, fp):
13421357
expected = df.copy()
13431358
check_round_trip(df, fp, expected=expected)
13441359

1345-
@pytest.mark.xfail(
1346-
_HAVE_FASTPARQUET and Version(fastparquet.__version__) > Version("2022.12"),
1347-
reason="fastparquet bug, see https://github.com/dask/fastparquet/issues/929",
1348-
)
1349-
@pytest.mark.skipif(using_copy_on_write(), reason="fastparquet writes into Index")
1350-
def test_timezone_aware_index(self, fp, timezone_aware_date_list):
1360+
def test_timezone_aware_index(self, fp, timezone_aware_date_list, request):
1361+
import fastparquet
1362+
1363+
if Version(fastparquet.__version__) < Version("2024.11.0"):
1364+
request.applymarker(
1365+
pytest.mark.xfail(
1366+
reason=(
1367+
"fastparquet bug, see "
1368+
"https://github.com/dask/fastparquet/issues/929"
1369+
),
1370+
)
1371+
)
1372+
13511373
idx = 5 * [timezone_aware_date_list]
13521374

13531375
df = pd.DataFrame(index=idx, data={"index_as_col": idx})

0 commit comments

Comments
 (0)