From b7d1476f9a0d0a2380895b2ce6ac6fdd1db105b0 Mon Sep 17 00:00:00 2001 From: Julian Badillo Date: Mon, 15 May 2023 20:05:40 +0000 Subject: [PATCH 01/11] BUG: Add am/pm parsing support on guess_format --- pandas/_libs/tslibs/parsing.pyx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandas/_libs/tslibs/parsing.pyx b/pandas/_libs/tslibs/parsing.pyx index 0cf03ecf34c41..dbaba8c8c9913 100644 --- a/pandas/_libs/tslibs/parsing.pyx +++ b/pandas/_libs/tslibs/parsing.pyx @@ -1019,6 +1019,11 @@ def guess_datetime_format(dt_str: str, bint dayfirst=False) -> str | None: output_format.append(tokens[i]) + # if am/pm token present, replace 24-hour %H, with 12-hour %I + if "%p" in format_guess and "%H" in format_guess: + i = format_guess.index("%H") + format_guess[i] = "%I" + guessed_format = "".join(output_format) try: From a9c9734ce1f3a811e511d352020bd948dae07124 Mon Sep 17 00:00:00 2001 From: Julian Badillo Date: Mon, 15 May 2023 20:14:30 +0000 Subject: [PATCH 02/11] :pick: add unit tests --- pandas/tests/tools/test_to_datetime.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pandas/tests/tools/test_to_datetime.py b/pandas/tests/tools/test_to_datetime.py index 0b5696116e610..8eee9e9725506 100644 --- a/pandas/tests/tools/test_to_datetime.py +++ b/pandas/tests/tools/test_to_datetime.py @@ -2942,6 +2942,11 @@ class TestDatetimeParsingWrappers: ("2005-11-09 10:15", datetime(2005, 11, 9, 10, 15)), ("2005-11-09 08H", datetime(2005, 11, 9, 8, 0)), ("2005/11/09 10:15", datetime(2005, 11, 9, 10, 15)), + ("2005/11/09 10:15 AM", datetime(2005, 11, 9, 10, 15)), + ("2005/11/09 10:15 PM", datetime(2005, 11, 9, 22, 15)), + ("2005/11/09 10:15:32", datetime(2005, 11, 9, 10, 15, 32)), + ("2005/11/09 10:15:32 AM", datetime(2005, 11, 9, 10, 15, 32)), + ("2005/11/09 10:15:32 PM", datetime(2005, 11, 9, 22, 15, 32)), ("2005/11/09 08H", datetime(2005, 11, 9, 8, 0)), ("Thu Sep 25 10:36:28 2003", datetime(2003, 9, 25, 10, 36, 28)), ("Thu Sep 25 2003", datetime(2003, 9, 25)), From 9fae954a44897124d331ee862df775e40f566f1d Mon Sep 17 00:00:00 2001 From: Julian Badillo Date: Mon, 15 May 2023 20:30:58 +0000 Subject: [PATCH 03/11] more unit tests --- pandas/tests/tslibs/test_parsing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandas/tests/tslibs/test_parsing.py b/pandas/tests/tslibs/test_parsing.py index 587527c2058d7..c73d03a633f12 100644 --- a/pandas/tests/tslibs/test_parsing.py +++ b/pandas/tests/tslibs/test_parsing.py @@ -208,6 +208,8 @@ def test_parsers_month_freq(date_str, expected): ("2011-12-30T00:00:00.000000+9:0", "%Y-%m-%dT%H:%M:%S.%f%z"), ("2011-12-30T00:00:00.000000+09:", None), ("2011-12-30 00:00:00.000000", "%Y-%m-%d %H:%M:%S.%f"), + ("2005/11/09 10:15 AM", "%Y/%m/%d %I:%M %p"), + ("2005/11/09 10:15:32 AM", "%Y/%m/%d %I:%M:%S %p"), ("Tue 24 Aug 2021 01:30:48 AM", "%a %d %b %Y %H:%M:%S %p"), ("Tuesday 24 Aug 2021 01:30:48 AM", "%A %d %b %Y %H:%M:%S %p"), ("27.03.2003 14:55:00.000", "%d.%m.%Y %H:%M:%S.%f"), # GH50317 From 36f7d860dc414e344cd5da6895626040f24d2fb4 Mon Sep 17 00:00:00 2001 From: Julian Badillo Date: Tue, 16 May 2023 13:42:51 +0000 Subject: [PATCH 04/11] :pick: not guess am/pm mark --- pandas/_libs/tslibs/parsing.pyx | 6 ------ pandas/tests/tools/test_to_datetime.py | 4 ---- pandas/tests/tslibs/test_parsing.py | 6 ++---- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/pandas/_libs/tslibs/parsing.pyx b/pandas/_libs/tslibs/parsing.pyx index dbaba8c8c9913..c7a3da3d378b7 100644 --- a/pandas/_libs/tslibs/parsing.pyx +++ b/pandas/_libs/tslibs/parsing.pyx @@ -908,7 +908,6 @@ def guess_datetime_format(dt_str: str, bint dayfirst=False) -> str | None: (("tzinfo",), "%Z", 0), (("day_of_week",), "%a", 0), (("day_of_week",), "%A", 0), - (("meridiem",), "%p", 0), ] if dayfirst: @@ -1019,11 +1018,6 @@ def guess_datetime_format(dt_str: str, bint dayfirst=False) -> str | None: output_format.append(tokens[i]) - # if am/pm token present, replace 24-hour %H, with 12-hour %I - if "%p" in format_guess and "%H" in format_guess: - i = format_guess.index("%H") - format_guess[i] = "%I" - guessed_format = "".join(output_format) try: diff --git a/pandas/tests/tools/test_to_datetime.py b/pandas/tests/tools/test_to_datetime.py index 8eee9e9725506..b8079375b2aaf 100644 --- a/pandas/tests/tools/test_to_datetime.py +++ b/pandas/tests/tools/test_to_datetime.py @@ -2942,11 +2942,7 @@ class TestDatetimeParsingWrappers: ("2005-11-09 10:15", datetime(2005, 11, 9, 10, 15)), ("2005-11-09 08H", datetime(2005, 11, 9, 8, 0)), ("2005/11/09 10:15", datetime(2005, 11, 9, 10, 15)), - ("2005/11/09 10:15 AM", datetime(2005, 11, 9, 10, 15)), - ("2005/11/09 10:15 PM", datetime(2005, 11, 9, 22, 15)), ("2005/11/09 10:15:32", datetime(2005, 11, 9, 10, 15, 32)), - ("2005/11/09 10:15:32 AM", datetime(2005, 11, 9, 10, 15, 32)), - ("2005/11/09 10:15:32 PM", datetime(2005, 11, 9, 22, 15, 32)), ("2005/11/09 08H", datetime(2005, 11, 9, 8, 0)), ("Thu Sep 25 10:36:28 2003", datetime(2003, 9, 25, 10, 36, 28)), ("Thu Sep 25 2003", datetime(2003, 9, 25)), diff --git a/pandas/tests/tslibs/test_parsing.py b/pandas/tests/tslibs/test_parsing.py index c73d03a633f12..a885040128b65 100644 --- a/pandas/tests/tslibs/test_parsing.py +++ b/pandas/tests/tslibs/test_parsing.py @@ -208,10 +208,8 @@ def test_parsers_month_freq(date_str, expected): ("2011-12-30T00:00:00.000000+9:0", "%Y-%m-%dT%H:%M:%S.%f%z"), ("2011-12-30T00:00:00.000000+09:", None), ("2011-12-30 00:00:00.000000", "%Y-%m-%d %H:%M:%S.%f"), - ("2005/11/09 10:15 AM", "%Y/%m/%d %I:%M %p"), - ("2005/11/09 10:15:32 AM", "%Y/%m/%d %I:%M:%S %p"), - ("Tue 24 Aug 2021 01:30:48 AM", "%a %d %b %Y %H:%M:%S %p"), - ("Tuesday 24 Aug 2021 01:30:48 AM", "%A %d %b %Y %H:%M:%S %p"), + ("Tue 24 Aug 2021 01:30:48", "%a %d %b %Y %H:%M:%S"), + ("Tuesday 24 Aug 2021 01:30:48", "%A %d %b %Y %H:%M:%S"), ("27.03.2003 14:55:00.000", "%d.%m.%Y %H:%M:%S.%f"), # GH50317 ], ) From 6f1a4c2f2d6aab54a42f3329bfa09841e160be79 Mon Sep 17 00:00:00 2001 From: Julian Badillo Date: Tue, 16 May 2023 15:25:06 +0000 Subject: [PATCH 05/11] :beetle: bug fix parsing am/pm tokens --- pandas/_libs/tslibs/parsing.pyx | 6 ++++++ pandas/tests/tools/test_to_datetime.py | 2 ++ pandas/tests/tslibs/test_parsing.py | 2 ++ 3 files changed, 10 insertions(+) diff --git a/pandas/_libs/tslibs/parsing.pyx b/pandas/_libs/tslibs/parsing.pyx index c7a3da3d378b7..71550824525eb 100644 --- a/pandas/_libs/tslibs/parsing.pyx +++ b/pandas/_libs/tslibs/parsing.pyx @@ -908,6 +908,7 @@ def guess_datetime_format(dt_str: str, bint dayfirst=False) -> str | None: (("tzinfo",), "%Z", 0), (("day_of_week",), "%a", 0), (("day_of_week",), "%A", 0), + (("meridiem",), "%p", 0), ] if dayfirst: @@ -1018,6 +1019,11 @@ def guess_datetime_format(dt_str: str, bint dayfirst=False) -> str | None: output_format.append(tokens[i]) + # if am/pm token present, replace 24-hour %H, with 12-hour %I + if "%p" in output_format and "%H" in output_format: + i = output_format.index("%H") + output_format[i] = "%I" + guessed_format = "".join(output_format) try: diff --git a/pandas/tests/tools/test_to_datetime.py b/pandas/tests/tools/test_to_datetime.py index b8079375b2aaf..92b4370e9d736 100644 --- a/pandas/tests/tools/test_to_datetime.py +++ b/pandas/tests/tools/test_to_datetime.py @@ -2943,6 +2943,8 @@ class TestDatetimeParsingWrappers: ("2005-11-09 08H", datetime(2005, 11, 9, 8, 0)), ("2005/11/09 10:15", datetime(2005, 11, 9, 10, 15)), ("2005/11/09 10:15:32", datetime(2005, 11, 9, 10, 15, 32)), + ("2005/11/09 10:15:32 AM", datetime(2005, 11, 9, 10, 15, 32)), + ("2005/11/09 10:15:32 PM", datetime(2005, 11, 9, 22, 15, 32)), ("2005/11/09 08H", datetime(2005, 11, 9, 8, 0)), ("Thu Sep 25 10:36:28 2003", datetime(2003, 9, 25, 10, 36, 28)), ("Thu Sep 25 2003", datetime(2003, 9, 25)), diff --git a/pandas/tests/tslibs/test_parsing.py b/pandas/tests/tslibs/test_parsing.py index a885040128b65..8408c9df5962b 100644 --- a/pandas/tests/tslibs/test_parsing.py +++ b/pandas/tests/tslibs/test_parsing.py @@ -210,6 +210,8 @@ def test_parsers_month_freq(date_str, expected): ("2011-12-30 00:00:00.000000", "%Y-%m-%d %H:%M:%S.%f"), ("Tue 24 Aug 2021 01:30:48", "%a %d %b %Y %H:%M:%S"), ("Tuesday 24 Aug 2021 01:30:48", "%A %d %b %Y %H:%M:%S"), + ("Tue 24 Aug 2021 01:30:48 AM", "%a %d %b %Y %I:%M:%S %p"), + ("Tuesday 24 Aug 2021 01:30:48 AM", "%A %d %b %Y %I:%M:%S %p"), ("27.03.2003 14:55:00.000", "%d.%m.%Y %H:%M:%S.%f"), # GH50317 ], ) From d3cf50c7955bc2d8f0d47172af5c9766235aa3db Mon Sep 17 00:00:00 2001 From: Julian Badillo Date: Tue, 16 May 2023 15:26:53 +0000 Subject: [PATCH 06/11] :pencil: whatsnew --- doc/source/whatsnew/v2.1.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v2.1.0.rst b/doc/source/whatsnew/v2.1.0.rst index 201bf23ea2339..b4b606e349f51 100644 --- a/doc/source/whatsnew/v2.1.0.rst +++ b/doc/source/whatsnew/v2.1.0.rst @@ -352,7 +352,7 @@ Conversion - Bug in :meth:`DataFrame.__repr__` incorrectly raising a ``TypeError`` when the dtype of a column is ``np.record`` (:issue:`48526`) - Bug in :meth:`DataFrame.info` raising ``ValueError`` when ``use_numba`` is set (:issue:`51922`) - Bug in :meth:`DataFrame.insert` raising ``TypeError`` if ``loc`` is ``np.int64`` (:issue:`53193`) -- +- Bug in :meth:`datetimes._guess_datetime_format` if contains "AM" / "PM" tokens (:issue:`53147`) Strings ^^^^^^^ From 3fd61bb220a09965dd5b253d4ca7a905c84a2ab5 Mon Sep 17 00:00:00 2001 From: Julian Badillo Date: Tue, 16 May 2023 18:54:00 +0000 Subject: [PATCH 07/11] :pencil: whats new doc --- doc/source/whatsnew/v2.1.0.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v2.1.0.rst b/doc/source/whatsnew/v2.1.0.rst index b4b606e349f51..7815b502f6db5 100644 --- a/doc/source/whatsnew/v2.1.0.rst +++ b/doc/source/whatsnew/v2.1.0.rst @@ -317,6 +317,7 @@ Datetimelike - Bug in :meth:`Timestamp.round` with values close to the implementation bounds returning incorrect results instead of raising ``OutOfBoundsDatetime`` (:issue:`51494`) - Bug in :meth:`arrays.DatetimeArray.map` and :meth:`DatetimeIndex.map`, where the supplied callable operated array-wise instead of element-wise (:issue:`51977`) - Bug in parsing datetime strings with weekday but no day e.g. "2023 Sept Thu" incorrectly raising ``AttributeError`` instead of ``ValueError`` (:issue:`52659`) +- Bug in :func:`to_datetime`, if date contains "AM" / "PM" tokens (:issue:`53147`) - Timedelta @@ -352,7 +353,7 @@ Conversion - Bug in :meth:`DataFrame.__repr__` incorrectly raising a ``TypeError`` when the dtype of a column is ``np.record`` (:issue:`48526`) - Bug in :meth:`DataFrame.info` raising ``ValueError`` when ``use_numba`` is set (:issue:`51922`) - Bug in :meth:`DataFrame.insert` raising ``TypeError`` if ``loc`` is ``np.int64`` (:issue:`53193`) -- Bug in :meth:`datetimes._guess_datetime_format` if contains "AM" / "PM" tokens (:issue:`53147`) +- Strings ^^^^^^^ From 6b8eeb45f5f25569160fd2c6385156016d9f81a0 Mon Sep 17 00:00:00 2001 From: Julian Badillo Date: Tue, 16 May 2023 20:09:00 +0000 Subject: [PATCH 08/11] isort on whatsnew entry --- doc/source/whatsnew/v2.1.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v2.1.0.rst b/doc/source/whatsnew/v2.1.0.rst index 7815b502f6db5..77d89f5143fe2 100644 --- a/doc/source/whatsnew/v2.1.0.rst +++ b/doc/source/whatsnew/v2.1.0.rst @@ -314,10 +314,10 @@ Datetimelike ^^^^^^^^^^^^ - :meth:`DatetimeIndex.map` with ``na_action="ignore"`` now works as expected. (:issue:`51644`) - Bug in :func:`date_range` when ``freq`` was a :class:`DateOffset` with ``nanoseconds`` (:issue:`46877`) +- Bug in :func:`to_datetime`, if date contains "AM" / "PM" tokens (:issue:`53147`) - Bug in :meth:`Timestamp.round` with values close to the implementation bounds returning incorrect results instead of raising ``OutOfBoundsDatetime`` (:issue:`51494`) - Bug in :meth:`arrays.DatetimeArray.map` and :meth:`DatetimeIndex.map`, where the supplied callable operated array-wise instead of element-wise (:issue:`51977`) - Bug in parsing datetime strings with weekday but no day e.g. "2023 Sept Thu" incorrectly raising ``AttributeError`` instead of ``ValueError`` (:issue:`52659`) -- Bug in :func:`to_datetime`, if date contains "AM" / "PM" tokens (:issue:`53147`) - Timedelta From 7825c337d72ebf9049fb0ce35f51921441b74558 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Wed, 17 May 2023 11:46:55 +0100 Subject: [PATCH 09/11] move whatsnew note to 2.0.1 --- doc/source/whatsnew/v2.0.1.rst | 1 + doc/source/whatsnew/v2.1.0.rst | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v2.0.1.rst b/doc/source/whatsnew/v2.0.1.rst index 2613d12e43400..af5eb87820ea7 100644 --- a/doc/source/whatsnew/v2.0.1.rst +++ b/doc/source/whatsnew/v2.0.1.rst @@ -37,6 +37,7 @@ Bug fixes - Bug in :func:`pandas.testing.assert_series_equal` where ``check_dtype=False`` would still raise for datetime or timedelta types with different resolutions (:issue:`52449`) - Bug in :func:`read_csv` casting PyArrow datetimes to NumPy when ``dtype_backend="pyarrow"`` and ``parse_dates`` is set causing a performance bottleneck in the process (:issue:`52546`) - Bug in :func:`to_datetime` and :func:`to_timedelta` when trying to convert numeric data with a :class:`ArrowDtype` (:issue:`52425`) +- Bug in :func:`to_datetime`, if date contains "AM" / "PM" tokens (:issue:`53147`) - Bug in :func:`to_numeric` with ``errors='coerce'`` and ``dtype_backend='pyarrow'`` with :class:`ArrowDtype` data (:issue:`52588`) - Bug in :meth:`ArrowDtype.__from_arrow__` not respecting if dtype is explicitly given (:issue:`52533`) - Bug in :meth:`DataFrame.describe` not respecting ``ArrowDtype`` in ``include`` and ``exclude`` (:issue:`52570`) diff --git a/doc/source/whatsnew/v2.1.0.rst b/doc/source/whatsnew/v2.1.0.rst index 77d89f5143fe2..201bf23ea2339 100644 --- a/doc/source/whatsnew/v2.1.0.rst +++ b/doc/source/whatsnew/v2.1.0.rst @@ -314,7 +314,6 @@ Datetimelike ^^^^^^^^^^^^ - :meth:`DatetimeIndex.map` with ``na_action="ignore"`` now works as expected. (:issue:`51644`) - Bug in :func:`date_range` when ``freq`` was a :class:`DateOffset` with ``nanoseconds`` (:issue:`46877`) -- Bug in :func:`to_datetime`, if date contains "AM" / "PM" tokens (:issue:`53147`) - Bug in :meth:`Timestamp.round` with values close to the implementation bounds returning incorrect results instead of raising ``OutOfBoundsDatetime`` (:issue:`51494`) - Bug in :meth:`arrays.DatetimeArray.map` and :meth:`DatetimeIndex.map`, where the supplied callable operated array-wise instead of element-wise (:issue:`51977`) - Bug in parsing datetime strings with weekday but no day e.g. "2023 Sept Thu" incorrectly raising ``AttributeError`` instead of ``ValueError`` (:issue:`52659`) From 5d1f1c8bee87ae59618dd805627cc36318f5ba59 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Wed, 17 May 2023 11:47:39 +0100 Subject: [PATCH 10/11] 2.0.2, not 2.0.1 --- doc/source/whatsnew/v2.0.1.rst | 1 - doc/source/whatsnew/v2.0.2.rst | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v2.0.1.rst b/doc/source/whatsnew/v2.0.1.rst index af5eb87820ea7..2613d12e43400 100644 --- a/doc/source/whatsnew/v2.0.1.rst +++ b/doc/source/whatsnew/v2.0.1.rst @@ -37,7 +37,6 @@ Bug fixes - Bug in :func:`pandas.testing.assert_series_equal` where ``check_dtype=False`` would still raise for datetime or timedelta types with different resolutions (:issue:`52449`) - Bug in :func:`read_csv` casting PyArrow datetimes to NumPy when ``dtype_backend="pyarrow"`` and ``parse_dates`` is set causing a performance bottleneck in the process (:issue:`52546`) - Bug in :func:`to_datetime` and :func:`to_timedelta` when trying to convert numeric data with a :class:`ArrowDtype` (:issue:`52425`) -- Bug in :func:`to_datetime`, if date contains "AM" / "PM" tokens (:issue:`53147`) - Bug in :func:`to_numeric` with ``errors='coerce'`` and ``dtype_backend='pyarrow'`` with :class:`ArrowDtype` data (:issue:`52588`) - Bug in :meth:`ArrowDtype.__from_arrow__` not respecting if dtype is explicitly given (:issue:`52533`) - Bug in :meth:`DataFrame.describe` not respecting ``ArrowDtype`` in ``include`` and ``exclude`` (:issue:`52570`) diff --git a/doc/source/whatsnew/v2.0.2.rst b/doc/source/whatsnew/v2.0.2.rst index df7ebd8d4844f..080c3cc0ab40d 100644 --- a/doc/source/whatsnew/v2.0.2.rst +++ b/doc/source/whatsnew/v2.0.2.rst @@ -29,6 +29,7 @@ Bug fixes - Bug in :func:`api.interchange.from_dataframe` was returning :class:`DataFrame`'s of incorrect sizes when called on slices (:issue:`52824`) - Bug in :func:`api.interchange.from_dataframe` was unnecessarily raising on bitmasks (:issue:`49888`) - Bug in :func:`merge` when merging on datetime columns on different resolutions (:issue:`53200`) +- Bug in :func:`to_datetime`, if date contains "AM" / "PM" tokens (:issue:`53147`) - Bug in :func:`to_timedelta` was raising ``ValueError`` with ``pandas.NA`` (:issue:`52909`) - Bug in :meth:`DataFrame.__getitem__` not preserving dtypes for :class:`MultiIndex` partial keys (:issue:`51895`) - Bug in :meth:`DataFrame.convert_dtypes` ignores ``convert_*`` keywords when set to False ``dtype_backend="pyarrow"`` (:issue:`52872`) From 7f4eb2306aafd077c8ed66e2bf531d5e3c44d393 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Wed, 17 May 2023 11:49:08 +0100 Subject: [PATCH 11/11] clarify --- doc/source/whatsnew/v2.0.2.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v2.0.2.rst b/doc/source/whatsnew/v2.0.2.rst index 080c3cc0ab40d..57c305c8e21a8 100644 --- a/doc/source/whatsnew/v2.0.2.rst +++ b/doc/source/whatsnew/v2.0.2.rst @@ -29,7 +29,7 @@ Bug fixes - Bug in :func:`api.interchange.from_dataframe` was returning :class:`DataFrame`'s of incorrect sizes when called on slices (:issue:`52824`) - Bug in :func:`api.interchange.from_dataframe` was unnecessarily raising on bitmasks (:issue:`49888`) - Bug in :func:`merge` when merging on datetime columns on different resolutions (:issue:`53200`) -- Bug in :func:`to_datetime`, if date contains "AM" / "PM" tokens (:issue:`53147`) +- Bug in :func:`to_datetime` was inferring format to contain ``"%H"`` instead of ``"%I"`` if date contained "AM" / "PM" tokens (:issue:`53147`) - Bug in :func:`to_timedelta` was raising ``ValueError`` with ``pandas.NA`` (:issue:`52909`) - Bug in :meth:`DataFrame.__getitem__` not preserving dtypes for :class:`MultiIndex` partial keys (:issue:`51895`) - Bug in :meth:`DataFrame.convert_dtypes` ignores ``convert_*`` keywords when set to False ``dtype_backend="pyarrow"`` (:issue:`52872`)