From b6824a0547d153932ae366d9468612e5b6c229c8 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Tue, 17 May 2022 17:29:15 -0700 Subject: [PATCH 1/8] DEPS: Bump optional dependencies --- ci/deps/actions-38-minimum_versions.yaml | 53 ++++++++++++------------ pandas/compat/_optional.py | 51 +++++++++++------------ 2 files changed, 51 insertions(+), 53 deletions(-) diff --git a/ci/deps/actions-38-minimum_versions.yaml b/ci/deps/actions-38-minimum_versions.yaml index 99f8b89d1d562..d0d434bf6e45a 100644 --- a/ci/deps/actions-38-minimum_versions.yaml +++ b/ci/deps/actions-38-minimum_versions.yaml @@ -20,38 +20,37 @@ dependencies: - numpy=1.18.5 - pytz=2020.1 - # optional dependencies, markupsafe for jinja2 - - beautifulsoup4=4.8.2 - - blosc=1.20.1 - - bottleneck=1.3.1 + # optional dependencies + - beautifulsoup4=4.9.3 + - blosc=1.21.0 + - bottleneck=1.3.2 - brotlipy=0.7.0 - - fastparquet=0.4.0 - - fsspec=0.7.4 + - fastparquet=0.6.0 + - fsspec=2021.05.0 - html5lib=1.1 - - hypothesis=5.5.3 - - gcsfs=0.6.0 - - jinja2=2.11 - - lxml=4.5.0 - - markupsafe=2.0.1 - - matplotlib=3.3.2 - - numba=0.50.1 - - numexpr=2.7.1 + - hypothesis=6.13.0 + - gcsfs=2021.05.0 + - jinja2=3.0.0 + - lxml=4.6.3 + - matplotlib=3.4.2 + - numba=0.53.1 + - numexpr=2.7.3 - odfpy=1.4.1 - - openpyxl=3.0.3 - - pandas-gbq=0.14.0 - - psycopg2=2.8.4 - - pyarrow=1.0.1 - - pymysql=0.10.1 - - pyreadstat=1.1.0 + - openpyxl=3.0.7 + - pandas-gbq=0.15.0 + - psycopg2=2.8.6 + - pyarrow=4.0.0 + - pymysql=1.0.2 + - pyreadstat=1.1.2 - pytables=3.6.1 - python-snappy=0.6.0 - - pyxlsb=1.0.6 - - s3fs=0.4.0 - - scipy=1.4.1 - - sqlalchemy=1.4.0 - - tabulate=0.8.7 - - xarray=0.15.1 + - pyxlsb=1.0.8 + - s3fs=2021.05.0 + - scipy=1.7.1 + - sqlalchemy=1.4.16 + - tabulate=0.8.9 + - xarray=0.19.0 - xlrd=2.0.1 - - xlsxwriter=1.2.2 + - xlsxwriter=1.4.3 - xlwt=1.3.0 - zstandard=0.15.2 diff --git a/pandas/compat/_optional.py b/pandas/compat/_optional.py index 43134c3ab01d5..6e4d27b4b08c9 100644 --- a/pandas/compat/_optional.py +++ b/pandas/compat/_optional.py @@ -10,40 +10,39 @@ # Update install.rst when updating versions! VERSIONS = { - "bs4": "4.8.2", - "blosc": "1.20.1", - "bottleneck": "1.3.1", + "bs4": "4.9.3", + "blosc": "1.21.0", + "bottleneck": "1.3.2", "brotli": "0.7.0", - "fastparquet": "0.4.0", - "fsspec": "0.7.4", + "fastparquet": "0.6.0", + "fsspec": "2021.05.0", "html5lib": "1.1", - "hypothesis": "5.5.3", - "gcsfs": "0.6.0", - "jinja2": "2.11", - "lxml.etree": "4.5.0", - "markupsafe": "2.0.1", - "matplotlib": "3.3.2", - "numba": "0.50.1", - "numexpr": "2.7.1", + "hypothesis": "6.13.0", + "gcsfs": "2021.05.0", + "jinja2": "3.0.0", + "lxml.etree": "4.6.3", + "matplotlib": "3.4.2", + "numba": "0.53.1", + "numexpr": "2.7.3", "odfpy": "1.4.1", - "openpyxl": "3.0.3", - "pandas_gbq": "0.14.0", - "psycopg2": "2.8.4", # (dt dec pq3 ext lo64) - "pymysql": "0.10.1", - "pyarrow": "1.0.1", - "pyreadstat": "1.1.0", + "openpyxl": "3.0.7", + "pandas_gbq": "0.15.0", + "psycopg2": "2.8.6", # (dt dec pq3 ext lo64) + "pymysql": "1.0.2", + "pyarrow": "4.0.0", + "pyreadstat": "1.1.2", "pytest": "6.0", - "pyxlsb": "1.0.6", - "s3fs": "0.4.0", - "scipy": "1.4.1", + "pyxlsb": "1.0.8", + "s3fs": "2021.05.0", + "scipy": "1.7.1", "snappy": "0.6.0", - "sqlalchemy": "1.4.0", + "sqlalchemy": "1.4.16", "tables": "3.6.1", - "tabulate": "0.8.7", - "xarray": "0.15.1", + "tabulate": "0.8.9", + "xarray": "0.19.0", "xlrd": "2.0.1", "xlwt": "1.3.0", - "xlsxwriter": "1.2.2", + "xlsxwriter": "1.4.3", "zstandard": "0.15.2", } From 7eaf59c87a857d6398c2404605dc8ee78b804e71 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Tue, 17 May 2022 18:45:20 -0700 Subject: [PATCH 2/8] Dont bump pyarrow --- ci/deps/actions-38-minimum_versions.yaml | 2 +- pandas/compat/_optional.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/deps/actions-38-minimum_versions.yaml b/ci/deps/actions-38-minimum_versions.yaml index d0d434bf6e45a..169c0d77ca0a7 100644 --- a/ci/deps/actions-38-minimum_versions.yaml +++ b/ci/deps/actions-38-minimum_versions.yaml @@ -39,7 +39,7 @@ dependencies: - openpyxl=3.0.7 - pandas-gbq=0.15.0 - psycopg2=2.8.6 - - pyarrow=4.0.0 + - pyarrow=1.0.1 - pymysql=1.0.2 - pyreadstat=1.1.2 - pytables=3.6.1 diff --git a/pandas/compat/_optional.py b/pandas/compat/_optional.py index 6e4d27b4b08c9..1485d640f1b9e 100644 --- a/pandas/compat/_optional.py +++ b/pandas/compat/_optional.py @@ -29,7 +29,7 @@ "pandas_gbq": "0.15.0", "psycopg2": "2.8.6", # (dt dec pq3 ext lo64) "pymysql": "1.0.2", - "pyarrow": "4.0.0", + "pyarrow": "1.0.1", "pyreadstat": "1.1.2", "pytest": "6.0", "pyxlsb": "1.0.8", From 392871cd36d5823b196964956ed155cc9ef66237 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Tue, 17 May 2022 18:47:56 -0700 Subject: [PATCH 3/8] Correct fixed test --- pandas/tests/io/test_fsspec.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/pandas/tests/io/test_fsspec.py b/pandas/tests/io/test_fsspec.py index 91ea5e09aa013..9f4ad8b9c6789 100644 --- a/pandas/tests/io/test_fsspec.py +++ b/pandas/tests/io/test_fsspec.py @@ -3,8 +3,6 @@ import numpy as np import pytest -from pandas.compat._optional import VERSIONS - from pandas import ( DataFrame, date_range, @@ -294,21 +292,7 @@ def test_stata_options(fsspectest): @td.skip_if_no("tabulate") -def test_markdown_options(request, fsspectest): - import fsspec - - # error: Library stubs not installed for "tabulate" - # (or incompatible with Python 3.8) - import tabulate # type: ignore[import] - - request.node.add_marker( - pytest.mark.xfail( - fsspec.__version__ == VERSIONS["fsspec"] - and tabulate.__version__ == VERSIONS["tabulate"], - reason="Fails on the min version build", - raises=FileNotFoundError, - ) - ) +def test_markdown_options(fsspectest): df = DataFrame({"a": [0]}) df.to_markdown("testmem://afile", storage_options={"test": "md_write"}) assert fsspectest.test[0] == "md_write" From 26321614b1d7295e712fad29904bf25b633b866b Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Tue, 17 May 2022 20:09:20 -0700 Subject: [PATCH 4/8] Don't bump fastparquet --- ci/deps/actions-38-minimum_versions.yaml | 2 +- pandas/compat/_optional.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/deps/actions-38-minimum_versions.yaml b/ci/deps/actions-38-minimum_versions.yaml index 169c0d77ca0a7..1cb595a4b7d4d 100644 --- a/ci/deps/actions-38-minimum_versions.yaml +++ b/ci/deps/actions-38-minimum_versions.yaml @@ -25,7 +25,7 @@ dependencies: - blosc=1.21.0 - bottleneck=1.3.2 - brotlipy=0.7.0 - - fastparquet=0.6.0 + - fastparquet=0.4.0 - fsspec=2021.05.0 - html5lib=1.1 - hypothesis=6.13.0 diff --git a/pandas/compat/_optional.py b/pandas/compat/_optional.py index 1485d640f1b9e..60e5c7fccda4d 100644 --- a/pandas/compat/_optional.py +++ b/pandas/compat/_optional.py @@ -14,7 +14,7 @@ "blosc": "1.21.0", "bottleneck": "1.3.2", "brotli": "0.7.0", - "fastparquet": "0.6.0", + "fastparquet": "0.4.0", "fsspec": "2021.05.0", "html5lib": "1.1", "hypothesis": "6.13.0", From 0034c6cebf43dbf42e77204cb431ea4cc548c347 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Tue, 17 May 2022 21:55:55 -0700 Subject: [PATCH 5/8] Change whatsnew --- doc/source/whatsnew/v1.5.0.rst | 51 +++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.5.0.rst b/doc/source/whatsnew/v1.5.0.rst index 128fd68674f96..2b6afe73173bd 100644 --- a/doc/source/whatsnew/v1.5.0.rst +++ b/doc/source/whatsnew/v1.5.0.rst @@ -362,7 +362,56 @@ If installed, we now require: +=================+=================+==========+=========+ | mypy (dev) | 0.950 | | X | +-----------------+-----------------+----------+---------+ - +| beautifulsoup4 | 4.9.3 | | X | ++-----------------+-----------------+----------+---------+ +| blosc | 1.21.0 | | X | ++-----------------+-----------------+----------+---------+ +| bottleneck | 1.3.2 | | X | ++-----------------+-----------------+----------+---------+ +| fsspec | 2021.05.0 | | X | ++-----------------+-----------------+----------+---------+ +| hypothesis | 6.13.0 | | X | ++-----------------+-----------------+----------+---------+ +| gcsfs | 2021.05.0 | | X | ++-----------------+-----------------+----------+---------+ +| jinja2 | 3.0.0 | | X | ++-----------------+-----------------+----------+---------+ +| lxml | 4.6.3 | | X | ++-----------------+-----------------+----------+---------+ +| matplotlib | 3.4.2 | | X | ++-----------------+-----------------+----------+---------+ +| numba | 0.53.1 | | X | ++-----------------+-----------------+----------+---------+ +| numexpr | 2.7.3 | | X | ++-----------------+-----------------+----------+---------+ +| openpyxl | 3.0.7 | | X | ++-----------------+-----------------+----------+---------+ +| pandas-gbq | 0.15.0 | | X | ++-----------------+-----------------+----------+---------+ +| psycopg2 | 2.8.6 | | X | ++-----------------+-----------------+----------+---------+ +| pymysql | 1.0.2 | | X | ++-----------------+-----------------+----------+---------+ +| pyreadstat | 1.1.2 | | X | ++-----------------+-----------------+----------+---------+ +| pyreadstat | 1.1.2 | | X | ++-----------------+-----------------+----------+---------+ +| pyreadstat | 1.1.2 | | X | ++-----------------+-----------------+----------+---------+ +| pyxlsb | 1.0.8 | | X | ++-----------------+-----------------+----------+---------+ +| s3fs | 2021.05.0 | | X | ++-----------------+-----------------+----------+---------+ +| scipy | 1.7.1 | | X | ++-----------------+-----------------+----------+---------+ +| sqlalchemy | 1.4.16 | | X | ++-----------------+-----------------+----------+---------+ +| tabulate | 0.8.9 | | X | ++-----------------+-----------------+----------+---------+ +| xarray | 0.19.0 | | X | ++-----------------+-----------------+----------+---------+ +| xlsxwriter | 1.4.3 | | X | ++-----------------+-----------------+----------+---------+ For `optional libraries `_ the general recommendation is to use the latest version. The following table lists the lowest version per library that is currently being tested throughout the development of pandas. From 8f72ee56fe6c32bd694a4a0cc89b5cccd2cea8e8 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Tue, 17 May 2022 23:05:00 -0700 Subject: [PATCH 6/8] Clean up some tests --- pandas/plotting/_matplotlib/compat.py | 1 - .../tests/io/data/excel/high_surrogate.xlsx | Bin 10334 -> 0 bytes pandas/tests/io/excel/__init__.py | 15 ---------- pandas/tests/io/excel/test_readers.py | 21 +------------- pandas/tests/io/excel/test_writers.py | 14 +--------- pandas/tests/io/excel/test_xlrd.py | 26 ++++-------------- .../tests/io/formats/style/test_highlight.py | 1 - pandas/tests/plotting/frame/test_frame.py | 12 ++------ .../tests/series/methods/test_interpolate.py | 6 +--- 9 files changed, 11 insertions(+), 85 deletions(-) delete mode 100644 pandas/tests/io/data/excel/high_surrogate.xlsx diff --git a/pandas/plotting/_matplotlib/compat.py b/pandas/plotting/_matplotlib/compat.py index c731c40f10a05..0677ad345736f 100644 --- a/pandas/plotting/_matplotlib/compat.py +++ b/pandas/plotting/_matplotlib/compat.py @@ -15,5 +15,4 @@ def inner(): return inner -mpl_ge_3_4_0 = _mpl_version("3.4.0", operator.ge) mpl_ge_3_5_0 = _mpl_version("3.5.0", operator.ge) diff --git a/pandas/tests/io/data/excel/high_surrogate.xlsx b/pandas/tests/io/data/excel/high_surrogate.xlsx deleted file mode 100644 index 1e29b6bee6586ba9eb72fe6c706ccc71bb439322..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10334 zcmeHt1zQ~1wszwl2<{#nf;++834!3+!QCM^!L_jv2pZfyIH7TOf@^}ilK@{QGv_kH z%y<95J@q_YUDefVRqb8xyL79_!@yz#-~osL0DuC(tMWxC3lOBt^jWu~TEHqsv02=cD|8D<>XP_iuz!pr7A$gg2gN{4jPqUp}RK%-w zR%uPebqj!A$M1qirjELAg&EE%T6q1cnXS&~K&X9C;Z0McT%F;^Ne0?=YY9vhU6eu% zzU$Y`pDw8#(&@i2l#x&KP=AqH0(btrw^e8uF z2Oo3kK(&xW9nj762c8t76PogS1O(VHWC$J}xyc)6IZ}IA>p>%K~zlQ;+{Efl2uUM(hAXgM11Vw=`*uW8J?ev`G*Z#lE{Xb0CzYM(uq^JyLMGZcb z`5DrCIkgyzAtvu8D$_)v?&BxBfLvwwb3Flwil;$n@n zBmxs#fU3@|G&uRj!3BYV#xY6Cp=7o5sq57F)J2N4oClq2OAJHt=YlNxzGW(@iDQXM zj1d-1LL{tQ;$U2%6o2h*MXe>{t1_r5v6uU$!4>s9nLF_#slGEwdE02hp?nH^<0&}3 zPR3@lWp8_}DbBA6U%fQvv#2mmcjTw^Ffg@lKb1&r!@7OTtd!QPM#+hJ#Xch4^DOh+ zSG$Juc;KT)Cl3<1xc8_pAcCx53F6HDNfIfXR$6Gt6>%5{`-G>D*+8zf>|+w4&Su~e)VD&xXlXcZAcI+v$+9?>Fdzcnbypc zwRykGbU^*maz*)GkMp#0(Dr`9Z4Cvcc8Q*@iWruEy?B}n`9*ZO+X#7RZL#wv2?Ktd zp~2G9-crQ`v2dIX0_Ip(9Q1&obuP6@8i&Nj$L7!Wsi%0=X{-QDTY-f9QqnL^?lwa%|( z?)a*4eQ9APk-oOAyjYPn6qK}y*qq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xzu*dR$_s= 2.0, only the xls format is supported:FutureWarning" ), ] - - -if import_optional_dependency("xlrd", errors="ignore") is None: - xlrd_version = None -else: - import xlrd - - xlrd_version = Version(get_version(xlrd)) diff --git a/pandas/tests/io/excel/test_readers.py b/pandas/tests/io/excel/test_readers.py index 1e0f74ea41453..f38b28fd583bf 100644 --- a/pandas/tests/io/excel/test_readers.py +++ b/pandas/tests/io/excel/test_readers.py @@ -21,8 +21,6 @@ Series, ) import pandas._testing as tm -from pandas.tests.io.excel import xlrd_version -from pandas.util.version import Version read_ext_params = [".xls", ".xlsx", ".xlsm", ".xlsb", ".ods"] engine_params = [ @@ -69,12 +67,7 @@ def _is_valid_engine_ext_pair(engine, read_ext: str) -> bool: return False if read_ext == ".xlsb" and engine != "pyxlsb": return False - if ( - engine == "xlrd" - and xlrd_version is not None - and xlrd_version >= Version("2") - and read_ext != ".xls" - ): + if engine == "xlrd" and read_ext != ".xls": return False return True @@ -1527,18 +1520,6 @@ def test_excel_read_binary_via_read_excel(self, read_ext, engine): expected = pd.read_excel("test1" + read_ext, engine=engine) tm.assert_frame_equal(result, expected) - @pytest.mark.skipif( - xlrd_version is not None and xlrd_version >= Version("2"), - reason="xlrd no longer supports xlsx", - ) - def test_excel_high_surrogate(self): - # GH 23809 - expected = DataFrame(["\udc88"], columns=["Column1"]) - - # should not produce a segmentation violation - actual = pd.read_excel("high_surrogate.xlsx", engine="xlrd") - tm.assert_frame_equal(expected, actual) - @pytest.mark.parametrize("filename", ["df_empty.xlsx", "df_equals.xlsx"]) def test_header_with_index_col(self, filename): # GH 33476 diff --git a/pandas/tests/io/excel/test_writers.py b/pandas/tests/io/excel/test_writers.py index 26c283a7dcc45..42483645d9fc3 100644 --- a/pandas/tests/io/excel/test_writers.py +++ b/pandas/tests/io/excel/test_writers.py @@ -21,7 +21,6 @@ option_context, ) import pandas._testing as tm -from pandas.util.version import Version from pandas.io.excel import ( ExcelFile, @@ -1091,8 +1090,7 @@ def test_comment_empty_line(self, path): result = pd.read_excel(path, comment="#") tm.assert_frame_equal(result, expected) - def test_datetimes(self, path, request): - openpyxl = pytest.importorskip("openpyxl") + def test_datetimes(self, path): # Test writing and reading datetimes. For issue #9139. (xref #9185) datetimes = [ datetime(2013, 1, 13, 1, 2, 3), @@ -1110,16 +1108,6 @@ def test_datetimes(self, path, request): write_frame = DataFrame({"A": datetimes}) write_frame.to_excel(path, "Sheet1") - if (path.endswith("xlsx") or path.endswith("xlsm")) and Version( - openpyxl.__version__ - ) < Version("3.0.6"): - request.node.add_marker( - pytest.mark.xfail( - reason="Defaults to openpyxl and fails with " - "floating point error on datetimes; may be fixed on " - "newer versions of openpyxl - GH #38644" - ) - ) read_frame = pd.read_excel(path, sheet_name="Sheet1", header=0) tm.assert_series_equal(write_frame["A"], read_frame["A"]) diff --git a/pandas/tests/io/excel/test_xlrd.py b/pandas/tests/io/excel/test_xlrd.py index f2ae668dee5a3..86141f08f5f2d 100644 --- a/pandas/tests/io/excel/test_xlrd.py +++ b/pandas/tests/io/excel/test_xlrd.py @@ -6,8 +6,6 @@ import pandas as pd import pandas._testing as tm -from pandas.tests.io.excel import xlrd_version -from pandas.util.version import Version from pandas.io.excel import ExcelFile from pandas.io.excel._base import inspect_excel_format @@ -20,11 +18,7 @@ ) -# error: Unsupported operand types for <= ("Version" and "None") -if xlrd_version >= Version("2"): # type: ignore[operator] - exts = [".xls"] -else: - exts = [".xls", ".xlsx", ".xlsm"] +exts = [".xls"] @pytest.fixture(params=exts) @@ -77,19 +71,11 @@ def test_read_excel_warning_with_xlsx_file(datapath): path = datapath("io", "data", "excel", "test1.xlsx") has_openpyxl = import_optional_dependency("openpyxl", errors="ignore") is not None if not has_openpyxl: - if xlrd_version >= Version("2"): - with pytest.raises( - ValueError, - match="Your version of xlrd is ", - ): - pd.read_excel(path, "Sheet1", engine=None) - else: - with tm.assert_produces_warning( - FutureWarning, - raise_on_extra_warnings=False, - match="The xlrd engine is no longer maintained", - ): - pd.read_excel(path, "Sheet1", engine=None) + with pytest.raises( + ValueError, + match="Your version of xlrd is ", + ): + pd.read_excel(path, "Sheet1", engine=None) else: with tm.assert_produces_warning(None): pd.read_excel(path, "Sheet1", engine=None) diff --git a/pandas/tests/io/formats/style/test_highlight.py b/pandas/tests/io/formats/style/test_highlight.py index 63138d87bc72f..3d59719010ee0 100644 --- a/pandas/tests/io/formats/style/test_highlight.py +++ b/pandas/tests/io/formats/style/test_highlight.py @@ -188,7 +188,6 @@ def test_highlight_quantile(styler, kwargs): assert result == expected -@pytest.mark.skipif(np.__version__[:4] in ["1.16", "1.17"], reason="Numpy Issue #14831") @pytest.mark.parametrize( "f,kwargs", [ diff --git a/pandas/tests/plotting/frame/test_frame.py b/pandas/tests/plotting/frame/test_frame.py index c4ce0b256cd41..eebcabb301a53 100644 --- a/pandas/tests/plotting/frame/test_frame.py +++ b/pandas/tests/plotting/frame/test_frame.py @@ -730,8 +730,6 @@ def test_plot_scatter_with_categorical_data(self, x, y): _check_plot_works(df.plot.scatter, x=x, y=y) def test_plot_scatter_with_c(self): - from pandas.plotting._matplotlib.compat import mpl_ge_3_4_0 - df = DataFrame( np.random.randn(6, 4), index=list(string.ascii_letters[:6]), @@ -743,10 +741,7 @@ def test_plot_scatter_with_c(self): # default to Greys assert ax.collections[0].cmap.name == "Greys" - if mpl_ge_3_4_0(): - assert ax.collections[0].colorbar.ax.get_ylabel() == "z" - else: - assert ax.collections[0].colorbar._label == "z" + assert ax.collections[0].colorbar.ax.get_ylabel() == "z" cm = "cubehelix" ax = df.plot.scatter(x="x", y="y", c="z", colormap=cm) @@ -1412,7 +1407,6 @@ def test_pie_df(self): self._check_colors(ax.patches, facecolors=color_args) def test_pie_df_nan(self): - import matplotlib as mpl df = DataFrame(np.random.rand(4, 4)) for i in range(4): @@ -1420,9 +1414,7 @@ def test_pie_df_nan(self): fig, axes = self.plt.subplots(ncols=4) # GH 37668 - kwargs = {} - if mpl.__version__ >= "3.3": - kwargs = {"normalize": True} + kwargs = {"normalize": True} with tm.assert_produces_warning(None): df.plot.pie(subplots=True, ax=axes, legend=True, **kwargs) diff --git a/pandas/tests/series/methods/test_interpolate.py b/pandas/tests/series/methods/test_interpolate.py index bd8b165335d09..c46f427fd6f09 100644 --- a/pandas/tests/series/methods/test_interpolate.py +++ b/pandas/tests/series/methods/test_interpolate.py @@ -12,7 +12,6 @@ isna, ) import pandas._testing as tm -from pandas.util.version import Version @pytest.fixture( @@ -791,11 +790,8 @@ def test_interpolate_timedelta_index(self, request, interp_methods_ind): df = pd.DataFrame([0, 1, np.nan, 3], index=ind) method, kwargs = interp_methods_ind - import scipy - if method in {"cubic", "zero"} or ( - method == "barycentric" and Version(scipy.__version__) < Version("1.5.0") - ): + if method in {"cubic", "zero"}: request.node.add_marker( pytest.mark.xfail( reason=f"{method} interpolation is not supported for TimedeltaIndex" From 26c229188f1b4cf50368657c4a5e520e54c8aaba Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Wed, 18 May 2022 09:51:37 -0700 Subject: [PATCH 7/8] Remove mpl version logic --- pandas/plotting/_matplotlib/tools.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/pandas/plotting/_matplotlib/tools.py b/pandas/plotting/_matplotlib/tools.py index bfbf77e85afd3..8c19b277adba4 100644 --- a/pandas/plotting/_matplotlib/tools.py +++ b/pandas/plotting/_matplotlib/tools.py @@ -22,8 +22,6 @@ ABCSeries, ) -from pandas.plotting._matplotlib import compat - if TYPE_CHECKING: from matplotlib.axes import Axes from matplotlib.axis import Axis @@ -391,11 +389,6 @@ def handle_shared_axes( row_num = lambda x: x.get_subplotspec().rowspan.start col_num = lambda x: x.get_subplotspec().colspan.start - if compat.mpl_ge_3_4_0(): - is_first_col = lambda x: x.get_subplotspec().is_first_col() - else: - is_first_col = lambda x: x.is_first_col() - if nrows > 1: try: # first find out the ax layout, @@ -416,12 +409,8 @@ def handle_shared_axes( except IndexError: # if gridspec is used, ax.rowNum and ax.colNum may different # from layout shape. in this case, use last_row logic - if compat.mpl_ge_3_4_0(): - is_last_row = lambda x: x.get_subplotspec().is_last_row() - else: - is_last_row = lambda x: x.is_last_row() for ax in axarr: - if is_last_row(ax): + if ax.get_subplotspec().is_last_row(): continue if sharex or _has_externally_shared_axis(ax, "x"): _remove_labels_from_axis(ax.xaxis) @@ -431,7 +420,7 @@ def handle_shared_axes( # only the first column should get y labels -> set all other to # off as we only have labels in the first column and we always # have a subplot there, we can skip the layout test - if is_first_col(ax): + if ax.get_subplotspec().is_first_col(): continue if sharey or _has_externally_shared_axis(ax, "y"): _remove_labels_from_axis(ax.yaxis) From ae765511f96523156bd2357f7afeef178b0c9267 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke Date: Wed, 18 May 2022 16:35:06 -0700 Subject: [PATCH 8/8] Undo matplotlib bump --- ci/deps/actions-38-minimum_versions.yaml | 2 +- doc/source/whatsnew/v1.5.0.rst | 6 ------ pandas/compat/_optional.py | 2 +- pandas/plotting/_matplotlib/compat.py | 1 + pandas/plotting/_matplotlib/tools.py | 15 +++++++++++++-- pandas/tests/plotting/frame/test_frame.py | 12 ++++++++++-- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/ci/deps/actions-38-minimum_versions.yaml b/ci/deps/actions-38-minimum_versions.yaml index 1cb595a4b7d4d..786b304bdfc1d 100644 --- a/ci/deps/actions-38-minimum_versions.yaml +++ b/ci/deps/actions-38-minimum_versions.yaml @@ -32,7 +32,7 @@ dependencies: - gcsfs=2021.05.0 - jinja2=3.0.0 - lxml=4.6.3 - - matplotlib=3.4.2 + - matplotlib=3.3.2 - numba=0.53.1 - numexpr=2.7.3 - odfpy=1.4.1 diff --git a/doc/source/whatsnew/v1.5.0.rst b/doc/source/whatsnew/v1.5.0.rst index 2b6afe73173bd..2ae85c704befc 100644 --- a/doc/source/whatsnew/v1.5.0.rst +++ b/doc/source/whatsnew/v1.5.0.rst @@ -378,8 +378,6 @@ If installed, we now require: +-----------------+-----------------+----------+---------+ | lxml | 4.6.3 | | X | +-----------------+-----------------+----------+---------+ -| matplotlib | 3.4.2 | | X | -+-----------------+-----------------+----------+---------+ | numba | 0.53.1 | | X | +-----------------+-----------------+----------+---------+ | numexpr | 2.7.3 | | X | @@ -394,10 +392,6 @@ If installed, we now require: +-----------------+-----------------+----------+---------+ | pyreadstat | 1.1.2 | | X | +-----------------+-----------------+----------+---------+ -| pyreadstat | 1.1.2 | | X | -+-----------------+-----------------+----------+---------+ -| pyreadstat | 1.1.2 | | X | -+-----------------+-----------------+----------+---------+ | pyxlsb | 1.0.8 | | X | +-----------------+-----------------+----------+---------+ | s3fs | 2021.05.0 | | X | diff --git a/pandas/compat/_optional.py b/pandas/compat/_optional.py index 60e5c7fccda4d..ad6c6fb839f10 100644 --- a/pandas/compat/_optional.py +++ b/pandas/compat/_optional.py @@ -21,7 +21,7 @@ "gcsfs": "2021.05.0", "jinja2": "3.0.0", "lxml.etree": "4.6.3", - "matplotlib": "3.4.2", + "matplotlib": "3.3.2", "numba": "0.53.1", "numexpr": "2.7.3", "odfpy": "1.4.1", diff --git a/pandas/plotting/_matplotlib/compat.py b/pandas/plotting/_matplotlib/compat.py index 0677ad345736f..c731c40f10a05 100644 --- a/pandas/plotting/_matplotlib/compat.py +++ b/pandas/plotting/_matplotlib/compat.py @@ -15,4 +15,5 @@ def inner(): return inner +mpl_ge_3_4_0 = _mpl_version("3.4.0", operator.ge) mpl_ge_3_5_0 = _mpl_version("3.5.0", operator.ge) diff --git a/pandas/plotting/_matplotlib/tools.py b/pandas/plotting/_matplotlib/tools.py index 8c19b277adba4..bfbf77e85afd3 100644 --- a/pandas/plotting/_matplotlib/tools.py +++ b/pandas/plotting/_matplotlib/tools.py @@ -22,6 +22,8 @@ ABCSeries, ) +from pandas.plotting._matplotlib import compat + if TYPE_CHECKING: from matplotlib.axes import Axes from matplotlib.axis import Axis @@ -389,6 +391,11 @@ def handle_shared_axes( row_num = lambda x: x.get_subplotspec().rowspan.start col_num = lambda x: x.get_subplotspec().colspan.start + if compat.mpl_ge_3_4_0(): + is_first_col = lambda x: x.get_subplotspec().is_first_col() + else: + is_first_col = lambda x: x.is_first_col() + if nrows > 1: try: # first find out the ax layout, @@ -409,8 +416,12 @@ def handle_shared_axes( except IndexError: # if gridspec is used, ax.rowNum and ax.colNum may different # from layout shape. in this case, use last_row logic + if compat.mpl_ge_3_4_0(): + is_last_row = lambda x: x.get_subplotspec().is_last_row() + else: + is_last_row = lambda x: x.is_last_row() for ax in axarr: - if ax.get_subplotspec().is_last_row(): + if is_last_row(ax): continue if sharex or _has_externally_shared_axis(ax, "x"): _remove_labels_from_axis(ax.xaxis) @@ -420,7 +431,7 @@ def handle_shared_axes( # only the first column should get y labels -> set all other to # off as we only have labels in the first column and we always # have a subplot there, we can skip the layout test - if ax.get_subplotspec().is_first_col(): + if is_first_col(ax): continue if sharey or _has_externally_shared_axis(ax, "y"): _remove_labels_from_axis(ax.yaxis) diff --git a/pandas/tests/plotting/frame/test_frame.py b/pandas/tests/plotting/frame/test_frame.py index eebcabb301a53..c4ce0b256cd41 100644 --- a/pandas/tests/plotting/frame/test_frame.py +++ b/pandas/tests/plotting/frame/test_frame.py @@ -730,6 +730,8 @@ def test_plot_scatter_with_categorical_data(self, x, y): _check_plot_works(df.plot.scatter, x=x, y=y) def test_plot_scatter_with_c(self): + from pandas.plotting._matplotlib.compat import mpl_ge_3_4_0 + df = DataFrame( np.random.randn(6, 4), index=list(string.ascii_letters[:6]), @@ -741,7 +743,10 @@ def test_plot_scatter_with_c(self): # default to Greys assert ax.collections[0].cmap.name == "Greys" - assert ax.collections[0].colorbar.ax.get_ylabel() == "z" + if mpl_ge_3_4_0(): + assert ax.collections[0].colorbar.ax.get_ylabel() == "z" + else: + assert ax.collections[0].colorbar._label == "z" cm = "cubehelix" ax = df.plot.scatter(x="x", y="y", c="z", colormap=cm) @@ -1407,6 +1412,7 @@ def test_pie_df(self): self._check_colors(ax.patches, facecolors=color_args) def test_pie_df_nan(self): + import matplotlib as mpl df = DataFrame(np.random.rand(4, 4)) for i in range(4): @@ -1414,7 +1420,9 @@ def test_pie_df_nan(self): fig, axes = self.plt.subplots(ncols=4) # GH 37668 - kwargs = {"normalize": True} + kwargs = {} + if mpl.__version__ >= "3.3": + kwargs = {"normalize": True} with tm.assert_produces_warning(None): df.plot.pie(subplots=True, ax=axes, legend=True, **kwargs)