From 625f0814291ce777c538d3d3594c2e6938b560d2 Mon Sep 17 00:00:00 2001 From: Brock Date: Sat, 13 Nov 2021 11:33:01 -0800 Subject: [PATCH 01/24] TST: troubleshoot xfails --- pandas/tests/frame/indexing/test_setitem.py | 8 +------ pandas/tests/generic/test_duplicate_labels.py | 1 - pandas/tests/io/json/test_pandas.py | 5 ---- .../tests/io/parser/common/test_chunksize.py | 23 +++---------------- pandas/tests/io/parser/test_compression.py | 7 ++++-- pandas/tests/io/parser/test_network.py | 2 -- pandas/tests/io/pytables/test_append.py | 13 +++-------- pandas/tests/io/pytables/test_select.py | 3 +-- pandas/tests/io/pytables/test_store.py | 4 +--- pandas/tests/io/test_parquet.py | 6 ----- pandas/tests/plotting/frame/test_frame.py | 5 ---- pandas/tests/plotting/test_converter.py | 10 +------- pandas/tests/plotting/test_groupby.py | 6 ----- pandas/tests/tseries/offsets/test_dst.py | 3 --- .../offsets/test_offsets_properties.py | 2 -- pandas/tests/window/test_rolling.py | 1 - 16 files changed, 15 insertions(+), 84 deletions(-) diff --git a/pandas/tests/frame/indexing/test_setitem.py b/pandas/tests/frame/indexing/test_setitem.py index 389bf56ab6035..3244a4f7ea0ba 100644 --- a/pandas/tests/frame/indexing/test_setitem.py +++ b/pandas/tests/frame/indexing/test_setitem.py @@ -1076,13 +1076,7 @@ def test_setitem_listlike_key_scalar_value_not_inplace(self, value): [ "a", ["a"], - pytest.param( - [True, False], - marks=pytest.mark.xfail( - reason="Boolean indexer incorrectly setting inplace", - strict=False, # passing on some builds, no obvious pattern - ), - ), + [True, False], ], ) @pytest.mark.parametrize( diff --git a/pandas/tests/generic/test_duplicate_labels.py b/pandas/tests/generic/test_duplicate_labels.py index 1b32675ec2d35..649ee35a647b1 100644 --- a/pandas/tests/generic/test_duplicate_labels.py +++ b/pandas/tests/generic/test_duplicate_labels.py @@ -94,7 +94,6 @@ def test_preserve_getitem(self): assert df.loc[[0]].flags.allows_duplicate_labels is False assert df.loc[0, ["A"]].flags.allows_duplicate_labels is False - @pytest.mark.xfail(reason="Unclear behavior.") def test_ndframe_getitem_caching_issue(self): # NDFrame.__getitem__ will cache the first df['A']. May need to # invalidate that cache? Update the cached entries? diff --git a/pandas/tests/io/json/test_pandas.py b/pandas/tests/io/json/test_pandas.py index 747770ad78684..f228c826bc795 100644 --- a/pandas/tests/io/json/test_pandas.py +++ b/pandas/tests/io/json/test_pandas.py @@ -1741,11 +1741,6 @@ def test_json_multiindex(self, dataframe, expected): result = series.to_json(orient="index") assert result == expected - @pytest.mark.xfail( - is_platform_windows(), - reason="localhost connection rejected", - strict=False, - ) def test_to_s3(self, s3_resource, s3so): import time diff --git a/pandas/tests/io/parser/common/test_chunksize.py b/pandas/tests/io/parser/common/test_chunksize.py index e8a8769bc6291..5d2072f6d2e22 100644 --- a/pandas/tests/io/parser/common/test_chunksize.py +++ b/pandas/tests/io/parser/common/test_chunksize.py @@ -162,7 +162,6 @@ def test_chunk_begins_with_newline_whitespace(all_parsers): @pytest.mark.slow -@pytest.mark.xfail(reason="GH38630, sometimes gives ResourceWarning", strict=False) def test_chunks_have_consistent_numerical_type(all_parsers): parser = all_parsers integers = [str(i) for i in range(499999)] @@ -176,7 +175,7 @@ def test_chunks_have_consistent_numerical_type(all_parsers): assert result.a.dtype == float -def test_warn_if_chunks_have_mismatched_type(all_parsers, request): +def test_warn_if_chunks_have_mismatched_type(all_parsers): warning_type = None parser = all_parsers size = 10000 @@ -193,24 +192,8 @@ def test_warn_if_chunks_have_mismatched_type(all_parsers, request): buf = StringIO(data) - try: - with tm.assert_produces_warning(warning_type): - df = parser.read_csv(buf) - except AssertionError as err: - # 2021-02-21 this occasionally fails on the CI with an unexpected - # ResourceWarning that we have been unable to track down, - # see GH#38630 - if "ResourceWarning" not in str(err) or parser.engine != "python": - raise - - # Check the main assertion of the test before re-raising - assert df.a.dtype == object - - mark = pytest.mark.xfail( - reason="ResourceWarning for unclosed SSL Socket, GH#38630" - ) - request.node.add_marker(mark) - raise + with tm.assert_produces_warning(warning_type): + df = parser.read_csv(buf) assert df.a.dtype == object diff --git a/pandas/tests/io/parser/test_compression.py b/pandas/tests/io/parser/test_compression.py index e0799df8d7a4c..f0710e918f110 100644 --- a/pandas/tests/io/parser/test_compression.py +++ b/pandas/tests/io/parser/test_compression.py @@ -89,7 +89,7 @@ def test_zip_error_invalid_zip(parser_and_data): @skip_pyarrow @pytest.mark.parametrize("filename", [None, "test.{ext}"]) -def test_compression(parser_and_data, compression_only, buffer, filename): +def test_compression(parser_and_data, compression_only, buffer, filename, request): parser, data, expected = parser_and_data compress_type = compression_only @@ -104,7 +104,10 @@ def test_compression(parser_and_data, compression_only, buffer, filename): compression = "infer" if filename else compress_type if ext == "bz2": - pytest.xfail("pyarrow wheels don't have bz2 codec support") + mark = pytest.mark.xfail( + reason="pyarrow wheels don't have bz2 codec support" + ) + request.node.add_marker(mark) if buffer: with open(path, "rb") as f: result = parser.read_csv(f, compression=compression) diff --git a/pandas/tests/io/parser/test_network.py b/pandas/tests/io/parser/test_network.py index 36f53bb1bb155..4e246ef54d58a 100644 --- a/pandas/tests/io/parser/test_network.py +++ b/pandas/tests/io/parser/test_network.py @@ -212,7 +212,6 @@ def test_read_s3_fails(self, s3so): with pytest.raises(OSError, match=msg): read_csv("s3://cant_get_it/file.csv") - @pytest.mark.xfail(reason="GH#39155 s3fs upgrade", strict=False) def test_write_s3_csv_fails(self, tips_df, s3so): # GH 32486 # Attempting to write to an invalid S3 path should raise @@ -228,7 +227,6 @@ def test_write_s3_csv_fails(self, tips_df, s3so): "s3://an_s3_bucket_data_doesnt_exit/not_real.csv", storage_options=s3so ) - @pytest.mark.xfail(reason="GH#39155 s3fs upgrade", strict=False) @td.skip_if_no("pyarrow") def test_write_s3_parquet_fails(self, tips_df, s3so): # GH 27679 diff --git a/pandas/tests/io/pytables/test_append.py b/pandas/tests/io/pytables/test_append.py index b5f9e6e74ece9..956b5e19b26ef 100644 --- a/pandas/tests/io/pytables/test_append.py +++ b/pandas/tests/io/pytables/test_append.py @@ -581,8 +581,7 @@ def check_col(key, name, size): & (df_new.A > 0) & (df_new.B < 0) ] - tm.assert_frame_equal(result, expected, check_freq=False) - # FIXME: 2020-05-07 freq check randomly fails in the CI + tm.assert_frame_equal(result, expected) # yield an empty frame result = store.select("df", "string='foo' and string2='cool'") @@ -611,9 +610,7 @@ def check_col(key, name, size): result = store.select("df_dc", ["B > 0", "C > 0", "string == foo"]) expected = df_dc[(df_dc.B > 0) & (df_dc.C > 0) & (df_dc.string == "foo")] - tm.assert_frame_equal(result, expected, check_freq=False) - # FIXME: 2020-12-07 intermittent build failures here with freq of - # None instead of BDay(4) + tm.assert_frame_equal(result, expected) with ensure_clean_store(setup_path) as store: # doc example part 2 @@ -896,9 +893,6 @@ def test_append_to_multiple_dropna(setup_path): tm.assert_index_equal(store.select("df1").index, store.select("df2").index) -@pytest.mark.xfail( - run=False, reason="append_to_multiple_dropna_false is not raising as failed" -) def test_append_to_multiple_dropna_false(setup_path): df1 = tm.makeTimeDataFrame() df2 = tm.makeTimeDataFrame().rename(columns="{}_2".format) @@ -912,8 +906,7 @@ def test_append_to_multiple_dropna_false(setup_path): {"df1a": ["A", "B"], "df2a": None}, df, selector="df1a", dropna=False ) - # TODO Update error message to desired message for this case - msg = "Cannot select as multiple after appending with dropna=False" + msg = "all tables must have exactly the same nrows!" with pytest.raises(ValueError, match=msg): store.select_as_multiple(["df1a", "df2a"]) diff --git a/pandas/tests/io/pytables/test_select.py b/pandas/tests/io/pytables/test_select.py index 56d48945d5852..17a7bf60b3187 100644 --- a/pandas/tests/io/pytables/test_select.py +++ b/pandas/tests/io/pytables/test_select.py @@ -838,8 +838,7 @@ def test_select_as_multiple(setup_path): ) expected = concat([df1, df2], axis=1) expected = expected[(expected.A > 0) & (expected.B > 0)] - tm.assert_frame_equal(result, expected, check_freq=False) - # FIXME: 2021-01-20 this is failing with freq None vs 4B on some builds + tm.assert_frame_equal(result, expected) # multiple (diff selector) result = store.select_as_multiple( diff --git a/pandas/tests/io/pytables/test_store.py b/pandas/tests/io/pytables/test_store.py index 856a2ca15ec4a..9ff30c53c1684 100644 --- a/pandas/tests/io/pytables/test_store.py +++ b/pandas/tests/io/pytables/test_store.py @@ -646,9 +646,7 @@ def test_coordinates(setup_path): expected = concat([df1, df2], axis=1) expected = expected[(expected.A > 0) & (expected.B > 0)] - tm.assert_frame_equal(result, expected, check_freq=False) - # FIXME: 2021-01-18 on some (mostly windows) builds we get freq=None - # but expect freq="18B" + tm.assert_frame_equal(result, expected) # pass array/mask as the coordinates with ensure_clean_store(setup_path) as store: diff --git a/pandas/tests/io/test_parquet.py b/pandas/tests/io/test_parquet.py index ec724602c5249..a9219cdc66bea 100644 --- a/pandas/tests/io/test_parquet.py +++ b/pandas/tests/io/test_parquet.py @@ -13,7 +13,6 @@ from pandas._config import get_option -from pandas.compat import is_platform_windows from pandas.compat.pyarrow import ( pa_version_under1p0, pa_version_under2p0, @@ -735,11 +734,6 @@ def test_categorical(self, pa): check_round_trip(df, pa) - @pytest.mark.xfail( - is_platform_windows(), - reason="localhost connection rejected", - strict=False, - ) def test_s3_roundtrip_explicit_fs(self, df_compat, s3_resource, pa, s3so): s3fs = pytest.importorskip("s3fs") s3 = s3fs.S3FileSystem(**s3so) diff --git a/pandas/tests/plotting/frame/test_frame.py b/pandas/tests/plotting/frame/test_frame.py index ccd0bc3d16896..a9026117b3c16 100644 --- a/pandas/tests/plotting/frame/test_frame.py +++ b/pandas/tests/plotting/frame/test_frame.py @@ -494,11 +494,6 @@ def test_line_lim(self): assert xmin <= lines[0].get_data()[0][0] assert xmax >= lines[0].get_data()[0][-1] - @pytest.mark.xfail( - strict=False, - reason="2020-12-01 this has been failing periodically on the " - "ymin==0 assertion for a week or so.", - ) @pytest.mark.parametrize("stacked", [True, False]) def test_area_lim(self, stacked): df = DataFrame(np.random.rand(6, 4), columns=["x", "y", "z", "four"]) diff --git a/pandas/tests/plotting/test_converter.py b/pandas/tests/plotting/test_converter.py index 75f2dcacf244d..1d9b14a739848 100644 --- a/pandas/tests/plotting/test_converter.py +++ b/pandas/tests/plotting/test_converter.py @@ -10,10 +10,7 @@ import pandas._config.config as cf -from pandas.compat import ( - is_platform_windows, - np_datetime64_compat, -) +from pandas.compat import np_datetime64_compat import pandas.util._test_decorators as td from pandas import ( @@ -92,11 +89,6 @@ def test_registering_no_warning(self): ax.plot(s.index, s.values) plt.close() - @pytest.mark.xfail( - is_platform_windows(), - reason="Getting two warnings intermittently, see GH#37746", - strict=False, - ) def test_pandas_plots_register(self): plt = pytest.importorskip("matplotlib.pyplot") s = Series(range(12), index=date_range("2017", periods=12)) diff --git a/pandas/tests/plotting/test_groupby.py b/pandas/tests/plotting/test_groupby.py index 76320767a6b01..997f5abe12078 100644 --- a/pandas/tests/plotting/test_groupby.py +++ b/pandas/tests/plotting/test_groupby.py @@ -4,7 +4,6 @@ import numpy as np import pytest -from pandas.compat import is_platform_windows import pandas.util._test_decorators as td from pandas import ( @@ -20,11 +19,6 @@ @td.skip_if_no_mpl class TestDataFrameGroupByPlots(TestPlotBase): - @pytest.mark.xfail( - is_platform_windows(), - reason="Looks like LinePlot._is_ts_plot is wrong", - strict=False, - ) def test_series_groupby_plotting_nominally_works(self): n = 10 weight = Series(np.random.normal(166, 20, size=n)) diff --git a/pandas/tests/tseries/offsets/test_dst.py b/pandas/tests/tseries/offsets/test_dst.py index 9721d7fbd9067..cbd0aa4a47c9a 100644 --- a/pandas/tests/tseries/offsets/test_dst.py +++ b/pandas/tests/tseries/offsets/test_dst.py @@ -177,9 +177,6 @@ def test_all_offset_classes(self, tup): assert first == second -@pytest.mark.xfail( - strict=False, reason="'Africa/Kinshasa' test case fails under pytz=2017.3" -) @pytest.mark.parametrize( "original_dt, target_dt, offset, tz", [ diff --git a/pandas/tests/tseries/offsets/test_offsets_properties.py b/pandas/tests/tseries/offsets/test_offsets_properties.py index 2d88f6690a794..58286b37eb207 100644 --- a/pandas/tests/tseries/offsets/test_offsets_properties.py +++ b/pandas/tests/tseries/offsets/test_offsets_properties.py @@ -14,7 +14,6 @@ given, strategies as st, ) -from hypothesis.errors import Flaky from hypothesis.extra.dateutil import timezones as dateutil_timezones from hypothesis.extra.pytz import timezones as pytz_timezones import pytest @@ -111,7 +110,6 @@ def test_on_offset_implementations(dt, offset): assert offset.is_on_offset(dt) == (compare == dt) -@pytest.mark.xfail(strict=False, raises=Flaky, reason="unreliable test timings") @given(gen_yqm_offset) def test_shift_across_dst(offset): # GH#18319 check that 1) timezone is correctly normalized and diff --git a/pandas/tests/window/test_rolling.py b/pandas/tests/window/test_rolling.py index 27b06e78d8ce2..0c0288b49c930 100644 --- a/pandas/tests/window/test_rolling.py +++ b/pandas/tests/window/test_rolling.py @@ -1634,7 +1634,6 @@ def test_rolling_quantile_np_percentile(): tm.assert_almost_equal(df_quantile.values, np.array(np_percentile)) -@pytest.mark.xfail(reason="GH#44343", strict=False) @pytest.mark.parametrize("quantile", [0.0, 0.1, 0.45, 0.5, 1]) @pytest.mark.parametrize( "interpolation", ["linear", "lower", "higher", "nearest", "midpoint"] From 5131837c8d1bb517eb18890df0ae4c4273077452 Mon Sep 17 00:00:00 2001 From: Brock Date: Sat, 13 Nov 2021 15:31:48 -0800 Subject: [PATCH 02/24] remove warning ignore --- pandas/tests/indexes/datetimes/test_indexing.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pandas/tests/indexes/datetimes/test_indexing.py b/pandas/tests/indexes/datetimes/test_indexing.py index c3152b77d39df..dffae520c0576 100644 --- a/pandas/tests/indexes/datetimes/test_indexing.py +++ b/pandas/tests/indexes/datetimes/test_indexing.py @@ -686,10 +686,6 @@ def test_get_indexer_mixed_dtypes(self, target): ([date(9999, 1, 1), date(9999, 1, 1)], [-1, -1]), ], ) - # FIXME: these warnings are flaky GH#36131 - @pytest.mark.filterwarnings( - "ignore:Comparison of Timestamp with datetime.date:FutureWarning" - ) def test_get_indexer_out_of_bounds_date(self, target, positions): values = DatetimeIndex([Timestamp("2020-01-01"), Timestamp("2020-01-02")]) From 90e4ce41f2617c3cd7885355b4b4abde4381f0fd Mon Sep 17 00:00:00 2001 From: Brock Date: Sun, 14 Nov 2021 15:03:52 -0800 Subject: [PATCH 03/24] re-xfail --- pandas/tests/frame/indexing/test_setitem.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pandas/tests/frame/indexing/test_setitem.py b/pandas/tests/frame/indexing/test_setitem.py index 63131d92816cc..bb1a1bc72116d 100644 --- a/pandas/tests/frame/indexing/test_setitem.py +++ b/pandas/tests/frame/indexing/test_setitem.py @@ -1089,7 +1089,13 @@ def test_setitem_listlike_key_scalar_value_not_inplace(self, value): [ "a", ["a"], - [True, False], + pytest.param( + [True, False], + marks=pytest.mark.xfail( + reason="Boolean indexer incorrectly setting inplace", + strict=False, # passing on some builds, no obvious pattern + ), + ), ], ) @pytest.mark.parametrize( From 4988ce61b6ac287cf58ea666f7e2f4f22ed665ad Mon Sep 17 00:00:00 2001 From: Brock Date: Sun, 14 Nov 2021 16:29:05 -0800 Subject: [PATCH 04/24] restore xfail --- pandas/tests/generic/test_duplicate_labels.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandas/tests/generic/test_duplicate_labels.py b/pandas/tests/generic/test_duplicate_labels.py index 649ee35a647b1..1b32675ec2d35 100644 --- a/pandas/tests/generic/test_duplicate_labels.py +++ b/pandas/tests/generic/test_duplicate_labels.py @@ -94,6 +94,7 @@ def test_preserve_getitem(self): assert df.loc[[0]].flags.allows_duplicate_labels is False assert df.loc[0, ["A"]].flags.allows_duplicate_labels is False + @pytest.mark.xfail(reason="Unclear behavior.") def test_ndframe_getitem_caching_issue(self): # NDFrame.__getitem__ will cache the first df['A']. May need to # invalidate that cache? Update the cached entries? From 531de6933eace60c2084d4035dbebb34100dc3a8 Mon Sep 17 00:00:00 2001 From: Brock Date: Sun, 14 Nov 2021 16:50:29 -0800 Subject: [PATCH 05/24] Troubleshoot windows timeouts --- ci/deps/azure-windows-38.yaml | 1 + ci/deps/azure-windows-39.yaml | 1 + pandas/tests/io/test_user_agent.py | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/ci/deps/azure-windows-38.yaml b/ci/deps/azure-windows-38.yaml index d4e2c482d1c1c..39d30accb1353 100644 --- a/ci/deps/azure-windows-38.yaml +++ b/ci/deps/azure-windows-38.yaml @@ -11,6 +11,7 @@ dependencies: - pytest-xdist>=1.31 - hypothesis>=5.5.3 - pytest-azurepipelines + - pytest-timeout # pandas dependencies - blosc diff --git a/ci/deps/azure-windows-39.yaml b/ci/deps/azure-windows-39.yaml index 0e352a80a6d34..244d0780a88a2 100644 --- a/ci/deps/azure-windows-39.yaml +++ b/ci/deps/azure-windows-39.yaml @@ -11,6 +11,7 @@ dependencies: - pytest-xdist>=1.31 - hypothesis>=5.5.3 - pytest-azurepipelines + - pytest-timeout # pandas dependencies - beautifulsoup4 diff --git a/pandas/tests/io/test_user_agent.py b/pandas/tests/io/test_user_agent.py index cabdbbdb44830..22e6258b144a0 100644 --- a/pandas/tests/io/test_user_agent.py +++ b/pandas/tests/io/test_user_agent.py @@ -13,6 +13,10 @@ import pandas as pd import pandas._testing as tm +# Troubleshooting build failures on Windows that tentatively look like +# they are stalling in this file. +pytestmark = pytest.mark.timeout(60) + class BaseUserAgentResponder(http.server.BaseHTTPRequestHandler): """ From 11ce3e18c50b3836205cf07f6d36e87253a9c7c7 Mon Sep 17 00:00:00 2001 From: Brock Date: Sun, 14 Nov 2021 18:18:28 -0800 Subject: [PATCH 06/24] force cI From 1d90c72c54d014cdb09a61eccf47d8b855ae0466 Mon Sep 17 00:00:00 2001 From: Brock Date: Mon, 15 Nov 2021 10:05:05 -0800 Subject: [PATCH 07/24] add pytest-timeout to all builds --- ci/deps/actions-38-db-min.yaml | 1 + ci/deps/actions-38-db.yaml | 1 + ci/deps/actions-38-locale.yaml | 1 + ci/deps/actions-38-locale_slow.yaml | 1 + ci/deps/actions-38-minimum_versions.yaml | 1 + ci/deps/actions-38-slow.yaml | 1 + ci/deps/actions-38.yaml | 1 + ci/deps/actions-39-numpydev.yaml | 1 + ci/deps/actions-39-slow.yaml | 1 + ci/deps/actions-39.yaml | 1 + ci/deps/azure-macos-38.yaml | 1 + ci/deps/circle-38-arm64.yaml | 2 ++ 12 files changed, 13 insertions(+) diff --git a/ci/deps/actions-38-db-min.yaml b/ci/deps/actions-38-db-min.yaml index f875f2ef88949..481a0bd03ffb9 100644 --- a/ci/deps/actions-38-db-min.yaml +++ b/ci/deps/actions-38-db-min.yaml @@ -9,6 +9,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # required diff --git a/ci/deps/actions-38-db.yaml b/ci/deps/actions-38-db.yaml index 7b73f43b7ba03..18c7c32c939a5 100644 --- a/ci/deps/actions-38-db.yaml +++ b/ci/deps/actions-38-db.yaml @@ -10,6 +10,7 @@ dependencies: - pytest-xdist>=1.31 - hypothesis>=5.5.3 - pytest-cov>=2.10.1 # this is only needed in the coverage build, ref: GH 35737 + - pytest-timeout # pandas dependencies - aiobotocore<2.0.0 diff --git a/ci/deps/actions-38-locale.yaml b/ci/deps/actions-38-locale.yaml index 13b132109effb..8df94493404b9 100644 --- a/ci/deps/actions-38-locale.yaml +++ b/ci/deps/actions-38-locale.yaml @@ -10,6 +10,7 @@ dependencies: - pytest-cov - pytest-xdist>=1.31 - pytest-asyncio>=0.12.0 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/actions-38-locale_slow.yaml b/ci/deps/actions-38-locale_slow.yaml index 0ff5dd6c3f7f0..0df71cbb40663 100644 --- a/ci/deps/actions-38-locale_slow.yaml +++ b/ci/deps/actions-38-locale_slow.yaml @@ -10,6 +10,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/actions-38-minimum_versions.yaml b/ci/deps/actions-38-minimum_versions.yaml index cc1fd022ad24c..8a58c823864ad 100644 --- a/ci/deps/actions-38-minimum_versions.yaml +++ b/ci/deps/actions-38-minimum_versions.yaml @@ -9,6 +9,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 - psutil diff --git a/ci/deps/actions-38-slow.yaml b/ci/deps/actions-38-slow.yaml index 903bd25655bd2..c49471ff17800 100644 --- a/ci/deps/actions-38-slow.yaml +++ b/ci/deps/actions-38-slow.yaml @@ -9,6 +9,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/actions-38.yaml b/ci/deps/actions-38.yaml index 899913d6e8c70..c6df94c31bebf 100644 --- a/ci/deps/actions-38.yaml +++ b/ci/deps/actions-38.yaml @@ -10,6 +10,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/actions-39-numpydev.yaml b/ci/deps/actions-39-numpydev.yaml index 4a6acf55e265f..4b8c74d635323 100644 --- a/ci/deps/actions-39-numpydev.yaml +++ b/ci/deps/actions-39-numpydev.yaml @@ -8,6 +8,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/actions-39-slow.yaml b/ci/deps/actions-39-slow.yaml index 2d723354935d2..582a8c07cae82 100644 --- a/ci/deps/actions-39-slow.yaml +++ b/ci/deps/actions-39-slow.yaml @@ -10,6 +10,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/actions-39.yaml b/ci/deps/actions-39.yaml index 8751651ece115..fd51594539f8b 100644 --- a/ci/deps/actions-39.yaml +++ b/ci/deps/actions-39.yaml @@ -9,6 +9,7 @@ dependencies: - pytest>=6.0 - pytest-cov - pytest-xdist>=1.31 + - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/azure-macos-38.yaml b/ci/deps/azure-macos-38.yaml index fe6fa6ca37e01..b9a77ab663da7 100644 --- a/ci/deps/azure-macos-38.yaml +++ b/ci/deps/azure-macos-38.yaml @@ -10,6 +10,7 @@ dependencies: - pytest-xdist>=1.31 - hypothesis>=5.5.3 - pytest-azurepipelines + - pytest-timeout # pandas dependencies - beautifulsoup4 diff --git a/ci/deps/circle-38-arm64.yaml b/ci/deps/circle-38-arm64.yaml index 6627ed5073b46..611d3e43e8354 100644 --- a/ci/deps/circle-38-arm64.yaml +++ b/ci/deps/circle-38-arm64.yaml @@ -8,6 +8,8 @@ dependencies: - cython>=0.29.24 - pytest>=6.0 - pytest-xdist>=1.31 + - pytest-timeout + - hypothesis>=5.5.3 # pandas dependencies From f38b0a09f2a5901e21cf17f55586c7507ba835c0 Mon Sep 17 00:00:00 2001 From: Brock Date: Mon, 15 Nov 2021 11:46:29 -0800 Subject: [PATCH 08/24] add to deps --- .github/workflows/python-dev.yml | 2 +- environment.yml | 1 + requirements-dev.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-dev.yml b/.github/workflows/python-dev.yml index 824e7de3bde41..b0cfee8a0326c 100644 --- a/.github/workflows/python-dev.yml +++ b/.github/workflows/python-dev.yml @@ -50,7 +50,7 @@ jobs: python -m pip install --upgrade pip setuptools wheel pip install -i https://pypi.anaconda.org/scipy-wheels-nightly/simple numpy pip install git+https://github.com/nedbat/coveragepy.git - pip install cython python-dateutil pytz hypothesis pytest>=6.2.5 pytest-xdist pytest-cov + pip install cython python-dateutil pytz hypothesis pytest>=6.2.5 pytest-xdist pytest-cov pytest-timeout pip list - name: Build Pandas diff --git a/environment.yml b/environment.yml index b4a8b977359cb..2e0ab728b8d19 100644 --- a/environment.yml +++ b/environment.yml @@ -63,6 +63,7 @@ dependencies: - pytest-xdist>=1.31 - pytest-asyncio - pytest-instafail + - pytest-timeout # downstream tests - seaborn diff --git a/requirements-dev.txt b/requirements-dev.txt index 5673becbbe1cb..1765f9802d100 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -41,6 +41,7 @@ pytest-cov pytest-xdist>=1.31 pytest-asyncio pytest-instafail +pytest-timeout seaborn statsmodels ipywidgets From 727d03943474e7b12d096d69d99c2e1990c46fc7 Mon Sep 17 00:00:00 2001 From: Brock Date: Mon, 15 Nov 2021 11:48:06 -0800 Subject: [PATCH 09/24] check file leaks --- pandas/tests/io/formats/test_format.py | 1 + pandas/tests/io/parser/test_compression.py | 2 +- pandas/tests/io/parser/test_dialect.py | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pandas/tests/io/formats/test_format.py b/pandas/tests/io/formats/test_format.py index d9bd8f6809c73..ac2851aba1077 100644 --- a/pandas/tests/io/formats/test_format.py +++ b/pandas/tests/io/formats/test_format.py @@ -3303,6 +3303,7 @@ def test_repr_html_ipython_config(ip): "encoding, data", [(None, "abc"), ("utf-8", "abc"), ("gbk", "造成输出中文显示乱码"), ("foo", "abc")], ) +@td.check_file_leaks def test_filepath_or_buffer_arg( method, filepath_or_buffer, diff --git a/pandas/tests/io/parser/test_compression.py b/pandas/tests/io/parser/test_compression.py index 539f0d3d537cd..5aa0edfd8b46a 100644 --- a/pandas/tests/io/parser/test_compression.py +++ b/pandas/tests/io/parser/test_compression.py @@ -89,7 +89,7 @@ def test_zip_error_invalid_zip(parser_and_data): @skip_pyarrow @pytest.mark.parametrize("filename", [None, "test.{ext}"]) -def test_compression(parser_and_data, compression_only, buffer, filename, request): +def test_compression(parser_and_data, compression_only, buffer, filename): parser, data, expected = parser_and_data compress_type = compression_only diff --git a/pandas/tests/io/parser/test_dialect.py b/pandas/tests/io/parser/test_dialect.py index 55b193903bce0..a53cc1fc7390c 100644 --- a/pandas/tests/io/parser/test_dialect.py +++ b/pandas/tests/io/parser/test_dialect.py @@ -9,6 +9,7 @@ import pytest from pandas.errors import ParserWarning +import pandas.util._test_decorators as td from pandas import DataFrame import pandas._testing as tm @@ -84,6 +85,7 @@ class InvalidDialect: [None, "doublequote", "escapechar", "skipinitialspace", "quotechar", "quoting"], ) @pytest.mark.parametrize("value", ["dialect", "default", "other"]) +@td.check_file_leaks def test_dialect_conflict_except_delimiter(all_parsers, custom_dialect, arg, value): # see gh-23761. dialect_name, dialect_kwargs = custom_dialect From d5fe414c428e09ff227cbd709b79448677d69bd6 Mon Sep 17 00:00:00 2001 From: Brock Date: Tue, 16 Nov 2021 10:17:42 -0800 Subject: [PATCH 10/24] tigher xfail for pytz 2017.3 --- pandas/tests/tseries/offsets/test_dst.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/tests/tseries/offsets/test_dst.py b/pandas/tests/tseries/offsets/test_dst.py index cbd0aa4a47c9a..5b29b1ffcd336 100644 --- a/pandas/tests/tseries/offsets/test_dst.py +++ b/pandas/tests/tseries/offsets/test_dst.py @@ -180,12 +180,13 @@ def test_all_offset_classes(self, tup): @pytest.mark.parametrize( "original_dt, target_dt, offset, tz", [ - ( + pytest.param( Timestamp("1900-01-01"), Timestamp("1905-07-01"), MonthBegin(66), "Africa/Kinshasa", - ), # GH41906 + marks=pytest.mark.xfail(pytz.__version__ == "2017.3", reason="GH#41906"), + ), ( Timestamp("2021-10-01 01:15"), Timestamp("2021-10-31 01:15"), From 03d83259dfbcb1ac3e786e4863aca0b3f2cd1e0d Mon Sep 17 00:00:00 2001 From: Brock Date: Wed, 17 Nov 2021 10:40:11 -0800 Subject: [PATCH 11/24] xfail later pytz --- pandas/tests/io/parser/test_network.py | 2 ++ pandas/tests/tseries/offsets/test_dst.py | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pandas/tests/io/parser/test_network.py b/pandas/tests/io/parser/test_network.py index 4e246ef54d58a..36f53bb1bb155 100644 --- a/pandas/tests/io/parser/test_network.py +++ b/pandas/tests/io/parser/test_network.py @@ -212,6 +212,7 @@ def test_read_s3_fails(self, s3so): with pytest.raises(OSError, match=msg): read_csv("s3://cant_get_it/file.csv") + @pytest.mark.xfail(reason="GH#39155 s3fs upgrade", strict=False) def test_write_s3_csv_fails(self, tips_df, s3so): # GH 32486 # Attempting to write to an invalid S3 path should raise @@ -227,6 +228,7 @@ def test_write_s3_csv_fails(self, tips_df, s3so): "s3://an_s3_bucket_data_doesnt_exit/not_real.csv", storage_options=s3so ) + @pytest.mark.xfail(reason="GH#39155 s3fs upgrade", strict=False) @td.skip_if_no("pyarrow") def test_write_s3_parquet_fails(self, tips_df, s3so): # GH 27679 diff --git a/pandas/tests/tseries/offsets/test_dst.py b/pandas/tests/tseries/offsets/test_dst.py index 5b29b1ffcd336..50c5a91fc2390 100644 --- a/pandas/tests/tseries/offsets/test_dst.py +++ b/pandas/tests/tseries/offsets/test_dst.py @@ -185,7 +185,11 @@ def test_all_offset_classes(self, tup): Timestamp("1905-07-01"), MonthBegin(66), "Africa/Kinshasa", - marks=pytest.mark.xfail(pytz.__version__ == "2017.3", reason="GH#41906"), + marks=pytest.mark.xfail( + # error: Module has no attribute "__version__" + float(pytz.__version__) <= 2020.1, # type: ignore[attr-defined] + reason="GH#41906", + ), ), ( Timestamp("2021-10-01 01:15"), From f46aa66890b4ea10734204e12ca194340966e104 Mon Sep 17 00:00:00 2001 From: Brock Date: Fri, 19 Nov 2021 12:59:36 -0800 Subject: [PATCH 12/24] missing dep --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6c685d09ab55a..b716b46125410 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -43,7 +43,7 @@ jobs: /opt/python/cp38-cp38/bin/python -m venv ~/virtualenvs/pandas-dev && \ . ~/virtualenvs/pandas-dev/bin/activate && \ python -m pip install --no-deps -U pip wheel setuptools && \ - pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis pytest-azurepipelines && \ + pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis pytest-azurepipelines pytest-timeout && \ python setup.py build_ext -q -j2 && \ python -m pip install --no-build-isolation -e . && \ pytest -m 'not slow and not network and not clipboard' pandas --junitxml=test-data.xml" From f1b6c5f886983c620e3b9c24d833c906bfc366fb Mon Sep 17 00:00:00 2001 From: Brock Date: Sat, 20 Nov 2021 08:26:45 -0800 Subject: [PATCH 13/24] check_dtype --- pandas/tests/libs/test_join.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/tests/libs/test_join.py b/pandas/tests/libs/test_join.py index 17601d30739e3..ba2e6e7130929 100644 --- a/pandas/tests/libs/test_join.py +++ b/pandas/tests/libs/test_join.py @@ -112,8 +112,8 @@ def test_cython_right_outer_join(self): exp_rs = exp_rs.take(exp_ri) exp_rs[exp_ri == -1] = -1 - tm.assert_numpy_array_equal(ls, exp_ls, check_dtype=False) - tm.assert_numpy_array_equal(rs, exp_rs, check_dtype=False) + tm.assert_numpy_array_equal(ls, exp_ls) + tm.assert_numpy_array_equal(rs, exp_rs) def test_cython_inner_join(self): left = np.array([0, 1, 2, 1, 2, 0, 0, 1, 2, 3, 3], dtype=np.intp) @@ -134,8 +134,8 @@ def test_cython_inner_join(self): exp_rs = exp_rs.take(exp_ri) exp_rs[exp_ri == -1] = -1 - tm.assert_numpy_array_equal(ls, exp_ls, check_dtype=False) - tm.assert_numpy_array_equal(rs, exp_rs, check_dtype=False) + tm.assert_numpy_array_equal(ls, exp_ls) + tm.assert_numpy_array_equal(rs, exp_rs) @pytest.mark.parametrize("readonly", [True, False]) From f817d2d7c076f2d3b1fe6483d4da432dd59bcf37 Mon Sep 17 00:00:00 2001 From: Brock Date: Sat, 20 Nov 2021 16:49:38 -0800 Subject: [PATCH 14/24] re-xfail --- pandas/tests/plotting/frame/test_frame.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandas/tests/plotting/frame/test_frame.py b/pandas/tests/plotting/frame/test_frame.py index 1dd4e5c2693ad..6c07366e402d6 100644 --- a/pandas/tests/plotting/frame/test_frame.py +++ b/pandas/tests/plotting/frame/test_frame.py @@ -494,6 +494,11 @@ def test_line_lim(self): assert xmin <= lines[0].get_data()[0][0] assert xmax >= lines[0].get_data()[0][-1] + @pytest.mark.xfail( + strict=False, + reason="2020-12-01 this has been failing periodically on the " + "ymin==0 assertion for a week or so.", + ) @pytest.mark.parametrize("stacked", [True, False]) def test_area_lim(self, stacked): df = DataFrame(np.random.rand(6, 4), columns=["x", "y", "z", "four"]) From 8c10450a2df93e76a894c290b1f97110b8a7117f Mon Sep 17 00:00:00 2001 From: Brock Date: Tue, 23 Nov 2021 07:54:53 -0800 Subject: [PATCH 15/24] try to narrow down xfail --- pandas/tests/series/methods/test_astype.py | 10 ++++++++++ pandas/tests/series/test_constructors.py | 11 ++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/pandas/tests/series/methods/test_astype.py b/pandas/tests/series/methods/test_astype.py index a20667655590b..1edfe04d7fd48 100644 --- a/pandas/tests/series/methods/test_astype.py +++ b/pandas/tests/series/methods/test_astype.py @@ -3,6 +3,7 @@ timedelta, ) from importlib import reload +import locale import string import sys @@ -10,6 +11,10 @@ import pytest from pandas._libs.tslibs import iNaT +from pandas.compat import ( + PY39, + np_version_under1p19, +) import pandas.util._test_decorators as td from pandas import ( @@ -131,6 +136,11 @@ def test_astype_generic_timestamp_no_frequency(self, dtype, request): ser = Series(data) if np.dtype(dtype).name not in ["timedelta64", "datetime64"]: + # Trying to narrow down when this actually occurs + assert not PY39 + assert np_version_under1p19 + assert locale.getlocale()[0] != "en_US" + mark = pytest.mark.xfail(reason="GH#33890 Is assigned ns unit") request.node.add_marker(mark) diff --git a/pandas/tests/series/test_constructors.py b/pandas/tests/series/test_constructors.py index 692c040a33ff8..8db1ca9fe0f94 100644 --- a/pandas/tests/series/test_constructors.py +++ b/pandas/tests/series/test_constructors.py @@ -3,6 +3,7 @@ datetime, timedelta, ) +import locale from dateutil.tz import tzoffset import numpy as np @@ -13,7 +14,10 @@ iNaT, lib, ) -from pandas.compat.numpy import np_version_under1p19 +from pandas.compat import ( + PY39, + np_version_under1p19, +) import pandas.util._test_decorators as td from pandas.core.dtypes.common import ( @@ -1570,6 +1574,11 @@ def test_constructor_generic_timestamp_no_frequency(self, dtype, request): msg = "dtype has no unit. Please pass in" if np.dtype(dtype).name not in ["timedelta64", "datetime64"]: + # Trying to narrow down when this actually occurs + assert not PY39 + assert np_version_under1p19 + assert locale.getlocale()[0] != "en_US" + mark = pytest.mark.xfail(reason="GH#33890 Is assigned ns unit") request.node.add_marker(mark) From 5a4e682fbfd16b0c24d45daf3b5266d1abb86ee1 Mon Sep 17 00:00:00 2001 From: Brock Date: Thu, 25 Nov 2021 10:24:26 -0800 Subject: [PATCH 16/24] troubleshoot --- pandas/tests/series/methods/test_astype.py | 10 ---------- pandas/tests/series/test_constructors.py | 11 +---------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/pandas/tests/series/methods/test_astype.py b/pandas/tests/series/methods/test_astype.py index 1edfe04d7fd48..a20667655590b 100644 --- a/pandas/tests/series/methods/test_astype.py +++ b/pandas/tests/series/methods/test_astype.py @@ -3,7 +3,6 @@ timedelta, ) from importlib import reload -import locale import string import sys @@ -11,10 +10,6 @@ import pytest from pandas._libs.tslibs import iNaT -from pandas.compat import ( - PY39, - np_version_under1p19, -) import pandas.util._test_decorators as td from pandas import ( @@ -136,11 +131,6 @@ def test_astype_generic_timestamp_no_frequency(self, dtype, request): ser = Series(data) if np.dtype(dtype).name not in ["timedelta64", "datetime64"]: - # Trying to narrow down when this actually occurs - assert not PY39 - assert np_version_under1p19 - assert locale.getlocale()[0] != "en_US" - mark = pytest.mark.xfail(reason="GH#33890 Is assigned ns unit") request.node.add_marker(mark) diff --git a/pandas/tests/series/test_constructors.py b/pandas/tests/series/test_constructors.py index 8db1ca9fe0f94..692c040a33ff8 100644 --- a/pandas/tests/series/test_constructors.py +++ b/pandas/tests/series/test_constructors.py @@ -3,7 +3,6 @@ datetime, timedelta, ) -import locale from dateutil.tz import tzoffset import numpy as np @@ -14,10 +13,7 @@ iNaT, lib, ) -from pandas.compat import ( - PY39, - np_version_under1p19, -) +from pandas.compat.numpy import np_version_under1p19 import pandas.util._test_decorators as td from pandas.core.dtypes.common import ( @@ -1574,11 +1570,6 @@ def test_constructor_generic_timestamp_no_frequency(self, dtype, request): msg = "dtype has no unit. Please pass in" if np.dtype(dtype).name not in ["timedelta64", "datetime64"]: - # Trying to narrow down when this actually occurs - assert not PY39 - assert np_version_under1p19 - assert locale.getlocale()[0] != "en_US" - mark = pytest.mark.xfail(reason="GH#33890 Is assigned ns unit") request.node.add_marker(mark) From 752b2d0c679df90d120dffe4fe2a245833b523b8 Mon Sep 17 00:00:00 2001 From: Brock Date: Fri, 26 Nov 2021 19:36:38 -0800 Subject: [PATCH 17/24] troubleshoot win32 hacks --- pandas/tests/frame/test_reductions.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pandas/tests/frame/test_reductions.py b/pandas/tests/frame/test_reductions.py index 0161acd8b52cf..6402a08ca54a2 100644 --- a/pandas/tests/frame/test_reductions.py +++ b/pandas/tests/frame/test_reductions.py @@ -93,11 +93,9 @@ def wrapper(x): tm.assert_series_equal( result0, frame.apply(wrapper), check_dtype=check_dtype, rtol=rtol, atol=atol ) - # FIXME: HACK: win32 tm.assert_series_equal( result1, frame.apply(wrapper, axis=1), - check_dtype=False, rtol=rtol, atol=atol, ) @@ -200,9 +198,7 @@ def wrapper(x): result1 = f(axis=1, skipna=False) tm.assert_series_equal(result0, frame.apply(wrapper)) - tm.assert_series_equal( - result1, frame.apply(wrapper, axis=1), check_dtype=False - ) # FIXME: HACK: win32 + tm.assert_series_equal(result1, frame.apply(wrapper, axis=1)) else: skipna_wrapper = alternative wrapper = alternative From 59975d48032997e080f9e2cde35ec0fef0b76022 Mon Sep 17 00:00:00 2001 From: Brock Date: Sun, 28 Nov 2021 13:28:09 -0800 Subject: [PATCH 18/24] keep trying --- pandas/tests/io/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandas/tests/io/__init__.py b/pandas/tests/io/__init__.py index 3231e38b985af..6ffafe0d61351 100644 --- a/pandas/tests/io/__init__.py +++ b/pandas/tests/io/__init__.py @@ -24,4 +24,6 @@ pytest.mark.filterwarnings( "ignore:As the xlwt package is no longer maintained:FutureWarning" ), + # Troubleshooting build failures that look like network timeouts + pytest.mark.timeout(60), ] From d64c4d4782789b00e89f5bf8d5a2ec08dbf835ae Mon Sep 17 00:00:00 2001 From: Brock Date: Fri, 3 Dec 2021 12:40:21 -0800 Subject: [PATCH 19/24] troubleshoot more --- pandas/tests/frame/constructors/test_from_records.py | 5 +---- pandas/tests/plotting/test_datetimelike.py | 7 +------ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/pandas/tests/frame/constructors/test_from_records.py b/pandas/tests/frame/constructors/test_from_records.py index abb70089f1fef..4aa150afadef6 100644 --- a/pandas/tests/frame/constructors/test_from_records.py +++ b/pandas/tests/frame/constructors/test_from_records.py @@ -33,10 +33,7 @@ def test_from_records_with_datetimes(self): arrdata = [np.array([datetime(2005, 3, 1, 0, 0), None])] dtypes = [("EXPIRY", " Date: Mon, 6 Dec 2021 19:00:17 -0800 Subject: [PATCH 20/24] troubleshoot --- pandas/tests/extension/base/dim2.py | 5 +++++ pandas/tests/plotting/test_hist_method.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/pandas/tests/extension/base/dim2.py b/pandas/tests/extension/base/dim2.py index a86c07c604320..8c4f8fdbb0343 100644 --- a/pandas/tests/extension/base/dim2.py +++ b/pandas/tests/extension/base/dim2.py @@ -11,6 +11,7 @@ ) import pandas as pd +from pandas.core.arrays.integer import INT_STR_TO_DTYPE from pandas.tests.extension.base.base import BaseExtensionTests @@ -209,6 +210,7 @@ def test_reductions_2d_axis0(self, data, method, request): if method in ["sum", "prod"] and data.dtype.kind in ["i", "u"]: # FIXME: kludge if data.dtype.kind == "i": + dtype2 = INT_STR_TO_DTYPE[np.dtype(int).name]() if is_platform_windows() or not IS64: # FIXME: kludge for 32bit builds if result.dtype.itemsize == 4: @@ -218,6 +220,7 @@ def test_reductions_2d_axis0(self, data, method, request): else: dtype = pd.Int64Dtype() else: + dtype2 = INT_STR_TO_DTYPE[np.dtype(np.uint).name]() if is_platform_windows() or not IS64: # FIXME: kludge for 32bit builds if result.dtype.itemsize == 4: @@ -227,6 +230,8 @@ def test_reductions_2d_axis0(self, data, method, request): else: dtype = pd.UInt64Dtype() + assert type(dtype) is type(dtype2) + expected = data.astype(dtype) assert type(expected) == type(data), type(expected) assert dtype == expected.dtype diff --git a/pandas/tests/plotting/test_hist_method.py b/pandas/tests/plotting/test_hist_method.py index 403f4a2c06df1..85942839951fe 100644 --- a/pandas/tests/plotting/test_hist_method.py +++ b/pandas/tests/plotting/test_hist_method.py @@ -236,6 +236,11 @@ def test_hist_kde_color(self): @td.skip_if_no_mpl class TestDataFramePlots(TestPlotBase): + @pytest.mark.xfail( + reason="2021-12-06 ValueError: view limit minimum -36435.78943428784 is " + "less than 1 and is an invalid Matplotlib date value. This often happens " + "if you pass a non-datetime value to an axis that has datetime units" + ) def test_hist_df_legacy(self): from matplotlib.patches import Rectangle From a34b042ad2a0dce88ce4f1c5bf447cf7beb4b25a Mon Sep 17 00:00:00 2001 From: Brock Date: Mon, 6 Dec 2021 19:55:38 -0800 Subject: [PATCH 21/24] not callable --- pandas/tests/extension/base/dim2.py | 4 ++-- pandas/tests/plotting/test_converter.py | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pandas/tests/extension/base/dim2.py b/pandas/tests/extension/base/dim2.py index 8c4f8fdbb0343..b949d2eba41fe 100644 --- a/pandas/tests/extension/base/dim2.py +++ b/pandas/tests/extension/base/dim2.py @@ -210,7 +210,7 @@ def test_reductions_2d_axis0(self, data, method, request): if method in ["sum", "prod"] and data.dtype.kind in ["i", "u"]: # FIXME: kludge if data.dtype.kind == "i": - dtype2 = INT_STR_TO_DTYPE[np.dtype(int).name]() + dtype2 = INT_STR_TO_DTYPE[np.dtype(int).name] if is_platform_windows() or not IS64: # FIXME: kludge for 32bit builds if result.dtype.itemsize == 4: @@ -220,7 +220,7 @@ def test_reductions_2d_axis0(self, data, method, request): else: dtype = pd.Int64Dtype() else: - dtype2 = INT_STR_TO_DTYPE[np.dtype(np.uint).name]() + dtype2 = INT_STR_TO_DTYPE[np.dtype(np.uint).name] if is_platform_windows() or not IS64: # FIXME: kludge for 32bit builds if result.dtype.itemsize == 4: diff --git a/pandas/tests/plotting/test_converter.py b/pandas/tests/plotting/test_converter.py index 1d9b14a739848..940b0e8988d65 100644 --- a/pandas/tests/plotting/test_converter.py +++ b/pandas/tests/plotting/test_converter.py @@ -81,20 +81,20 @@ def test_dont_register_by_default(self): @td.skip_if_no("matplotlib", min_version="3.1.3") def test_registering_no_warning(self): plt = pytest.importorskip("matplotlib.pyplot") - s = Series(range(12), index=date_range("2017", periods=12)) + ser = Series(range(12), index=date_range("2017", periods=12)) _, ax = plt.subplots() # Set to the "warn" state, in case this isn't the first test run register_matplotlib_converters() - ax.plot(s.index, s.values) + ax.plot(ser.index, ser.values) plt.close() def test_pandas_plots_register(self): plt = pytest.importorskip("matplotlib.pyplot") - s = Series(range(12), index=date_range("2017", periods=12)) + ser = Series(range(12), index=date_range("2017", periods=12)) # Set to the "warn" state, in case this isn't the first test run with tm.assert_produces_warning(None) as w: - s.plot() + ser.plot() try: assert len(w) == 0 @@ -118,17 +118,17 @@ def test_option_no_warning(self): pytest.importorskip("matplotlib.pyplot") ctx = cf.option_context("plotting.matplotlib.register_converters", False) plt = pytest.importorskip("matplotlib.pyplot") - s = Series(range(12), index=date_range("2017", periods=12)) + ser = Series(range(12), index=date_range("2017", periods=12)) _, ax = plt.subplots() # Test without registering first, no warning with ctx: - ax.plot(s.index, s.values) + ax.plot(ser.index, ser.values) # Now test with registering register_matplotlib_converters() with ctx: - ax.plot(s.index, s.values) + ax.plot(ser.index, ser.values) plt.close() def test_registry_resets(self): From 974eaddc13118d7c1dca26c8a9348bcb4cb17249 Mon Sep 17 00:00:00 2001 From: Brock Date: Mon, 6 Dec 2021 20:28:21 -0800 Subject: [PATCH 22/24] hope against hope --- pandas/tests/extension/base/dim2.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pandas/tests/extension/base/dim2.py b/pandas/tests/extension/base/dim2.py index b949d2eba41fe..760a70bfb4cb7 100644 --- a/pandas/tests/extension/base/dim2.py +++ b/pandas/tests/extension/base/dim2.py @@ -204,13 +204,24 @@ def test_reductions_2d_axis0(self, data, method, request): else: raise AssertionError("Both reductions should raise or neither") + def get_reduction_result_dtype(dtype): + # windows and 32bit builds will in some cases have int32/uint32 + # where other builds will have int64/uint64. + if dtype.itemsize == 8: + return dtype + elif dtype.kind == "i": + return INT_STR_TO_DTYPE[np.dtype(int).name] + else: + # i.e. dtype.kind == "u" + return INT_STR_TO_DTYPE[np.dtype(np.uint).name] + if method in ["mean", "median", "sum", "prod"]: # std and var are not dtype-preserving expected = data if method in ["sum", "prod"] and data.dtype.kind in ["i", "u"]: # FIXME: kludge + dtype2 = get_reduction_result_dtype(data.dtype) if data.dtype.kind == "i": - dtype2 = INT_STR_TO_DTYPE[np.dtype(int).name] if is_platform_windows() or not IS64: # FIXME: kludge for 32bit builds if result.dtype.itemsize == 4: @@ -220,7 +231,6 @@ def test_reductions_2d_axis0(self, data, method, request): else: dtype = pd.Int64Dtype() else: - dtype2 = INT_STR_TO_DTYPE[np.dtype(np.uint).name] if is_platform_windows() or not IS64: # FIXME: kludge for 32bit builds if result.dtype.itemsize == 4: @@ -230,7 +240,7 @@ def test_reductions_2d_axis0(self, data, method, request): else: dtype = pd.UInt64Dtype() - assert type(dtype) is type(dtype2) + assert type(dtype) is type(dtype2), (dtype, dtype2) expected = data.astype(dtype) assert type(expected) == type(data), type(expected) From e6a1ab64da7601e47fc240e3d98818f92163a21f Mon Sep 17 00:00:00 2001 From: Brock Date: Tue, 7 Dec 2021 14:32:28 -0800 Subject: [PATCH 23/24] update helper --- pandas/tests/extension/base/dim2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/extension/base/dim2.py b/pandas/tests/extension/base/dim2.py index a38c9b32135e5..d86d43b0ef9e6 100644 --- a/pandas/tests/extension/base/dim2.py +++ b/pandas/tests/extension/base/dim2.py @@ -205,7 +205,7 @@ def get_reduction_result_dtype(dtype): # where other builds will have int64/uint64. if dtype.itemsize == 8: return dtype - elif dtype.kind == "i": + elif dtype.kind in "ib": return INT_STR_TO_DTYPE[np.dtype(int).name] else: # i.e. dtype.kind == "u" From b1485d603620adefb044d062582839b32941df00 Mon Sep 17 00:00:00 2001 From: Brock Date: Wed, 8 Dec 2021 07:51:10 -0800 Subject: [PATCH 24/24] post-rebase fixup --- ci/deps/actions-38-db.yaml | 1 - ci/deps/actions-38-locale.yaml | 1 - ci/deps/azure-macos-38.yaml | 1 - ci/deps/azure-windows-38.yaml | 1 - ci/deps/azure-windows-39.yaml | 1 - environment.yml | 1 - requirements-dev.txt | 1 - 7 files changed, 7 deletions(-) diff --git a/ci/deps/actions-38-db.yaml b/ci/deps/actions-38-db.yaml index 0017744607d18..aedf6f18816ca 100644 --- a/ci/deps/actions-38-db.yaml +++ b/ci/deps/actions-38-db.yaml @@ -11,7 +11,6 @@ dependencies: - pytest-timeout - hypothesis>=5.5.3 - pytest-cov>=2.10.1 # this is only needed in the coverage build, ref: GH 35737 - - pytest-timeout # pandas dependencies - aiobotocore<2.0.0 diff --git a/ci/deps/actions-38-locale.yaml b/ci/deps/actions-38-locale.yaml index a97738a3eca18..2e897bec10e2e 100644 --- a/ci/deps/actions-38-locale.yaml +++ b/ci/deps/actions-38-locale.yaml @@ -11,7 +11,6 @@ dependencies: - pytest-xdist>=1.31 - pytest-timeout - pytest-asyncio>=0.12.0 - - pytest-timeout - hypothesis>=5.5.3 # pandas dependencies diff --git a/ci/deps/azure-macos-38.yaml b/ci/deps/azure-macos-38.yaml index 6742b76389a19..e8e708b890821 100644 --- a/ci/deps/azure-macos-38.yaml +++ b/ci/deps/azure-macos-38.yaml @@ -11,7 +11,6 @@ dependencies: - pytest-timeout - hypothesis>=5.5.3 - pytest-azurepipelines - - pytest-timeout # pandas dependencies - beautifulsoup4 diff --git a/ci/deps/azure-windows-38.yaml b/ci/deps/azure-windows-38.yaml index bcf94a490ffe0..c4180375a1e90 100644 --- a/ci/deps/azure-windows-38.yaml +++ b/ci/deps/azure-windows-38.yaml @@ -12,7 +12,6 @@ dependencies: - pytest-timeout - hypothesis>=5.5.3 - pytest-azurepipelines - - pytest-timeout # pandas dependencies - blosc diff --git a/ci/deps/azure-windows-39.yaml b/ci/deps/azure-windows-39.yaml index c5351ceb9d2c3..0ddfde9874069 100644 --- a/ci/deps/azure-windows-39.yaml +++ b/ci/deps/azure-windows-39.yaml @@ -12,7 +12,6 @@ dependencies: - pytest-timeout - hypothesis>=5.5.3 - pytest-azurepipelines - - pytest-timeout # pandas dependencies - beautifulsoup4 diff --git a/environment.yml b/environment.yml index b8bbdce3f56f5..931464712f2cf 100644 --- a/environment.yml +++ b/environment.yml @@ -64,7 +64,6 @@ dependencies: - pytest-timeout - pytest-asyncio - pytest-instafail - - pytest-timeout # downstream tests - seaborn diff --git a/requirements-dev.txt b/requirements-dev.txt index 9a57d25a1809b..0753980a0069b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -42,7 +42,6 @@ pytest-xdist>=1.31 pytest-timeout pytest-asyncio pytest-instafail -pytest-timeout seaborn statsmodels ipywidgets