Skip to content

Commit 95cb899

Browse files
mroeschkesimonjayhawkins
authored andcommitted
Backport PR pandas-dev#45651: CI/TST: Skip another s3 test that can crash GHA worker
1 parent ee3b62a commit 95cb899

File tree

6 files changed

+24
-43
lines changed

6 files changed

+24
-43
lines changed

.github/workflows/posix.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
COVERAGE: ${{ !contains(matrix.settings[0], 'pypy') }}
5151
concurrency:
5252
# https://github.community/t/concurrecy-not-work-for-push/183068/7
53-
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }}-${{ matrix.settings[1] }}
53+
group: ${{ github.event_name == 'push' && github.run_number || github.ref }}-${{ matrix.settings[0] }}-${{ matrix.settings[1] }}-${{ matrix.settings[2] }}
5454
cancel-in-progress: true
5555

5656
services:

pandas/tests/base/test_unique.py

+3
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ def test_nunique_null(null_obj, index_or_series_obj):
105105

106106

107107
@pytest.mark.single
108+
@pytest.mark.xfail(
109+
reason="Flaky in the CI. Remove once CI has a single build: GH 44584", strict=False
110+
)
108111
def test_unique_bad_unicode(index_or_series):
109112
# regression test for #34550
110113
uval = "\ud83d" # smiley emoji

pandas/tests/io/parser/test_network.py

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
StringIO,
88
)
99
import logging
10+
import os
1011

1112
import numpy as np
1213
import pytest
@@ -256,6 +257,12 @@ def test_read_csv_handles_boto_s3_object(self, s3_resource, tips_file):
256257
expected = read_csv(tips_file)
257258
tm.assert_frame_equal(result, expected)
258259

260+
@pytest.mark.skipif(
261+
os.environ.get("PANDAS_CI", "0") == "1",
262+
reason="This test can hang in our CI min_versions build "
263+
"and leads to '##[error]The runner has "
264+
"received a shutdown signal...' in GHA. GH: 45651",
265+
)
259266
def test_read_csv_chunked_download(self, s3_resource, caplog, s3so):
260267
# 8 MB, S3FS uses 5MB chunks
261268
import s3fs

pandas/tests/io/test_fsspec.py

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

6-
from pandas.compat import PY310
76
from pandas.compat._optional import VERSIONS
87

98
from pandas import (
@@ -182,7 +181,6 @@ def test_arrowparquet_options(fsspectest):
182181

183182
@td.skip_array_manager_not_yet_implemented # TODO(ArrayManager) fastparquet
184183
@td.skip_if_no("fastparquet")
185-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
186184
def test_fastparquet_options(fsspectest):
187185
"""Regression test for writing to a not-yet-existent GCS Parquet file."""
188186
df = DataFrame({"a": [0]})

pandas/tests/io/test_parquet.py

+5-37
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
from pandas._config import get_option
1515

16-
from pandas.compat import PY310
1716
from pandas.compat.pyarrow import (
1817
pa_version_under2p0,
1918
pa_version_under5p0,
@@ -262,7 +261,6 @@ def test_options_py(df_compat, pa):
262261
check_round_trip(df_compat)
263262

264263

265-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
266264
def test_options_fp(df_compat, fp):
267265
# use the set option
268266

@@ -340,7 +338,6 @@ def test_get_engine_auto_error_message():
340338
get_engine("auto")
341339

342340

343-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
344341
def test_cross_engine_pa_fp(df_cross_compat, pa, fp):
345342
# cross-compat with differing reading/writing engines
346343

@@ -407,11 +404,7 @@ def test_error(self, engine):
407404
msg = "to_parquet only supports IO with DataFrames"
408405
self.check_error_on_write(obj, engine, ValueError, msg)
409406

410-
def test_columns_dtypes(self, request, engine):
411-
if PY310 and engine == "fastparquet":
412-
request.node.add_marker(
413-
pytest.mark.xfail(reason="fastparquet failing on 3.10")
414-
)
407+
def test_columns_dtypes(self, engine):
415408
df = pd.DataFrame({"string": list("abc"), "int": list(range(1, 4))})
416409

417410
# unicode
@@ -438,39 +431,27 @@ def test_columns_dtypes_invalid(self, engine):
438431
self.check_error_on_write(df, engine, ValueError, msg)
439432

440433
@pytest.mark.parametrize("compression", [None, "gzip", "snappy", "brotli"])
441-
def test_compression(self, engine, compression, request):
434+
def test_compression(self, engine, compression):
442435

443436
if compression == "snappy":
444437
pytest.importorskip("snappy")
445438

446439
elif compression == "brotli":
447440
pytest.importorskip("brotli")
448441

449-
if PY310 and engine == "fastparquet":
450-
request.node.add_marker(
451-
pytest.mark.xfail(reason="fastparquet failing on 3.10")
452-
)
453442
df = pd.DataFrame({"A": [1, 2, 3]})
454443
check_round_trip(df, engine, write_kwargs={"compression": compression})
455444

456-
def test_read_columns(self, engine, request):
445+
def test_read_columns(self, engine):
457446
# GH18154
458-
if PY310 and engine == "fastparquet":
459-
request.node.add_marker(
460-
pytest.mark.xfail(reason="fastparquet failing on 3.10")
461-
)
462447
df = pd.DataFrame({"string": list("abc"), "int": list(range(1, 4))})
463448

464449
expected = pd.DataFrame({"string": list("abc")})
465450
check_round_trip(
466451
df, engine, expected=expected, read_kwargs={"columns": ["string"]}
467452
)
468453

469-
def test_write_index(self, engine, request):
470-
if PY310 and engine == "fastparquet":
471-
request.node.add_marker(
472-
pytest.mark.xfail(reason="fastparquet failing on 3.10")
473-
)
454+
def test_write_index(self, engine):
474455
check_names = engine != "fastparquet"
475456

476457
df = pd.DataFrame({"A": [1, 2, 3]})
@@ -519,13 +500,9 @@ def test_multiindex_with_columns(self, pa):
519500
df, engine, read_kwargs={"columns": ["A", "B"]}, expected=df[["A", "B"]]
520501
)
521502

522-
def test_write_ignoring_index(self, engine, request):
503+
def test_write_ignoring_index(self, engine):
523504
# ENH 20768
524505
# Ensure index=False omits the index from the written Parquet file.
525-
if PY310 and engine == "fastparquet":
526-
request.node.add_marker(
527-
pytest.mark.xfail(reason="fastparquet failing on 3.10")
528-
)
529506
df = pd.DataFrame({"a": [1, 2, 3], "b": ["q", "r", "s"]})
530507

531508
write_kwargs = {"compression": None, "index": False}
@@ -981,7 +958,6 @@ def test_read_parquet_manager(self, pa, using_array_manager):
981958

982959

983960
class TestParquetFastParquet(Base):
984-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
985961
def test_basic(self, fp, df_full):
986962
df = df_full
987963

@@ -999,7 +975,6 @@ def test_duplicate_columns(self, fp):
999975
msg = "Cannot create parquet dataset with duplicate column names"
1000976
self.check_error_on_write(df, fp, ValueError, msg)
1001977

1002-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
1003978
def test_bool_with_none(self, fp):
1004979
df = pd.DataFrame({"a": [True, None, False]})
1005980
expected = pd.DataFrame({"a": [1.0, np.nan, 0.0]}, dtype="float16")
@@ -1019,12 +994,10 @@ def test_unsupported(self, fp):
1019994
msg = "Can't infer object conversion type"
1020995
self.check_error_on_write(df, fp, ValueError, msg)
1021996

1022-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
1023997
def test_categorical(self, fp):
1024998
df = pd.DataFrame({"a": pd.Categorical(list("abc"))})
1025999
check_round_trip(df, fp)
10261000

1027-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
10281001
def test_filter_row_groups(self, fp):
10291002
d = {"a": list(range(0, 3))}
10301003
df = pd.DataFrame(d)
@@ -1043,7 +1016,6 @@ def test_s3_roundtrip(self, df_compat, s3_resource, fp, s3so):
10431016
write_kwargs={"compression": None, "storage_options": s3so},
10441017
)
10451018

1046-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
10471019
def test_partition_cols_supported(self, fp, df_full):
10481020
# GH #23283
10491021
partition_cols = ["bool", "int"]
@@ -1061,7 +1033,6 @@ def test_partition_cols_supported(self, fp, df_full):
10611033
actual_partition_cols = fastparquet.ParquetFile(path, False).cats
10621034
assert len(actual_partition_cols) == 2
10631035

1064-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
10651036
def test_partition_cols_string(self, fp, df_full):
10661037
# GH #27117
10671038
partition_cols = "bool"
@@ -1079,7 +1050,6 @@ def test_partition_cols_string(self, fp, df_full):
10791050
actual_partition_cols = fastparquet.ParquetFile(path, False).cats
10801051
assert len(actual_partition_cols) == 1
10811052

1082-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
10831053
def test_partition_on_supported(self, fp, df_full):
10841054
# GH #23283
10851055
partition_cols = ["bool", "int"]
@@ -1115,15 +1085,13 @@ def test_error_on_using_partition_cols_and_partition_on(self, fp, df_full):
11151085
partition_cols=partition_cols,
11161086
)
11171087

1118-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
11191088
def test_empty_dataframe(self, fp):
11201089
# GH #27339
11211090
df = pd.DataFrame()
11221091
expected = df.copy()
11231092
expected.index.name = "index"
11241093
check_round_trip(df, fp, expected=expected)
11251094

1126-
@pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10")
11271095
def test_timezone_aware_index(self, fp, timezone_aware_date_list):
11281096
idx = 5 * [timezone_aware_date_list]
11291097

pandas/tests/io/test_user_agent.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,25 @@
55
import http.server
66
from io import BytesIO
77
import multiprocessing
8+
import os
89
import socket
910
import time
1011
import urllib.error
1112

1213
import pytest
1314

14-
from pandas.compat import PY310
1515
import pandas.util._test_decorators as td
1616

1717
import pandas as pd
1818
import pandas._testing as tm
1919

20+
pytestmark = pytest.mark.skipif(
21+
os.environ.get("PANDAS_CI", "0") == "1",
22+
reason="This test can hang in our CI min_versions build "
23+
"and leads to '##[error]The runner has "
24+
"received a shutdown signal...' in GHA. GH 45651",
25+
)
26+
2027

2128
class BaseUserAgentResponder(http.server.BaseHTTPRequestHandler):
2229
"""
@@ -245,7 +252,6 @@ def responder(request):
245252
# TODO(ArrayManager) fastparquet
246253
marks=[
247254
td.skip_array_manager_not_yet_implemented,
248-
pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10"),
249255
],
250256
),
251257
(PickleUserAgentResponder, pd.read_pickle, None),
@@ -283,7 +289,6 @@ def test_server_and_default_headers(responder, read_method, parquet_engine):
283289
# TODO(ArrayManager) fastparquet
284290
marks=[
285291
td.skip_array_manager_not_yet_implemented,
286-
pytest.mark.xfail(PY310, reason="fastparquet failing on 3.10"),
287292
],
288293
),
289294
(PickleUserAgentResponder, pd.read_pickle, None),

0 commit comments

Comments
 (0)