From b1f23d072ff4972d70d34a962b4ec01415f921ac Mon Sep 17 00:00:00 2001 From: Mark Bekooy Date: Sun, 4 Feb 2024 14:29:57 +0100 Subject: [PATCH 1/3] Update type hint in format.py The brackets around the type hint broke the libcst parser. Since the brackets are not necessary for the type hint, they have been removed --- pandas/io/formats/format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/io/formats/format.py b/pandas/io/formats/format.py index 65124f97459cd..29f6e8ab96f71 100644 --- a/pandas/io/formats/format.py +++ b/pandas/io/formats/format.py @@ -1546,7 +1546,7 @@ def _format_strings(self) -> list[str]: def format_percentiles( - percentiles: (np.ndarray | Sequence[float]), + percentiles: np.ndarray | Sequence[float], ) -> list[str]: """ Outputs rounded and formatted percentiles. From bf8304ef8021464d59bf09720374c5d76288d09d Mon Sep 17 00:00:00 2001 From: Mark Bekooy Date: Sun, 4 Feb 2024 14:48:41 +0100 Subject: [PATCH 2/3] Update v2.2.1.rst --- doc/source/whatsnew/v2.2.1.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/whatsnew/v2.2.1.rst b/doc/source/whatsnew/v2.2.1.rst index 3cc11974b14e5..a802170352f24 100644 --- a/doc/source/whatsnew/v2.2.1.rst +++ b/doc/source/whatsnew/v2.2.1.rst @@ -35,6 +35,7 @@ Bug fixes - Fixed bug in :func:`pandas.api.interchange.from_dataframe` which was raising for empty inputs (:issue:`56700`) - Fixed bug in :func:`pandas.api.interchange.from_dataframe` which wasn't converting columns names to strings (:issue:`55069`) - Fixed bug in :meth:`DataFrame.__getitem__` for empty :class:`DataFrame` with Copy-on-Write enabled (:issue:`57130`) +- Fixed bug in :func:`format_percentiles` related to unneccesary brackets around type annotation (:issue:`57248`) .. --------------------------------------------------------------------------- .. _whatsnew_221.other: From 279f86aa3649b4b588c1fdc5940c955af292b82d Mon Sep 17 00:00:00 2001 From: Mark Bekooy Date: Sun, 4 Feb 2024 15:10:01 +0100 Subject: [PATCH 3/3] Undo update to v2.2.1.rst Type annotation changes are not added to change log --- doc/source/whatsnew/v2.2.1.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/whatsnew/v2.2.1.rst b/doc/source/whatsnew/v2.2.1.rst index a802170352f24..3cc11974b14e5 100644 --- a/doc/source/whatsnew/v2.2.1.rst +++ b/doc/source/whatsnew/v2.2.1.rst @@ -35,7 +35,6 @@ Bug fixes - Fixed bug in :func:`pandas.api.interchange.from_dataframe` which was raising for empty inputs (:issue:`56700`) - Fixed bug in :func:`pandas.api.interchange.from_dataframe` which wasn't converting columns names to strings (:issue:`55069`) - Fixed bug in :meth:`DataFrame.__getitem__` for empty :class:`DataFrame` with Copy-on-Write enabled (:issue:`57130`) -- Fixed bug in :func:`format_percentiles` related to unneccesary brackets around type annotation (:issue:`57248`) .. --------------------------------------------------------------------------- .. _whatsnew_221.other: