From 16c270bf048537191e0cc18604f560b74d7c2cd6 Mon Sep 17 00:00:00 2001 From: hulusierin Date: Tue, 7 Oct 2025 18:13:22 +0100 Subject: [PATCH 1/2] TST: Replace ensure_clean with temp_file in test_multi_thread.py --- pandas/tests/io/parser/test_multi_thread.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/tests/io/parser/test_multi_thread.py b/pandas/tests/io/parser/test_multi_thread.py index 348c19ac0f0c6..a0ccae5a84941 100644 --- a/pandas/tests/io/parser/test_multi_thread.py +++ b/pandas/tests/io/parser/test_multi_thread.py @@ -127,7 +127,7 @@ def reader(arg): @xfail_pyarrow # ValueError: The 'nrows' option is not supported -def test_multi_thread_path_multipart_read_csv(all_parsers): +def test_multi_thread_path_multipart_read_csv(tmp_path, all_parsers): # see gh-11786 num_tasks = 4 num_rows = 48 @@ -149,10 +149,10 @@ def test_multi_thread_path_multipart_read_csv(all_parsers): } ) - with tm.ensure_clean(file_name) as path: - df.to_csv(path) + path = tmp_path / file_name + df.to_csv(path) - result = _generate_multi_thread_dataframe(parser, path, num_rows, num_tasks) + result = _generate_multi_thread_dataframe(parser, path, num_rows, num_tasks) expected = df[:] expected["date"] = expected["date"].astype("M8[s]") From 1dd5afaa39e755cd5635b6dd4eb5f28c354c4555 Mon Sep 17 00:00:00 2001 From: hulusierin Date: Tue, 7 Oct 2025 18:22:18 +0100 Subject: [PATCH 2/2] TST: Replace ensure_clean with temp_file in test_multi_thread.py --- doc/source/whatsnew/v3.0.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v3.0.0.rst b/doc/source/whatsnew/v3.0.0.rst index bc41472b01478..448ceffdaa1eb 100644 --- a/doc/source/whatsnew/v3.0.0.rst +++ b/doc/source/whatsnew/v3.0.0.rst @@ -948,6 +948,7 @@ Datetimelike - Bug in :class:`Timestamp` constructor failing to raise when given a ``np.datetime64`` object with non-standard unit (:issue:`25611`) - Bug in :func:`date_range` where the last valid timestamp would sometimes not be produced (:issue:`56134`) - Bug in :func:`date_range` where using a negative frequency value would not include all points between the start and end values (:issue:`56147`) +- Bug in :func:`to_datetime` where passing an ``lxml.etree._ElementUnicodeResult`` together with ``format`` raised ``TypeError``. Now subclasses of ``str`` are handled. (:issue:`60933`) - Bug in :func:`tseries.api.guess_datetime_format` would fail to infer time format when "%Y" == "%H%M" (:issue:`57452`) - Bug in :func:`tseries.frequencies.to_offset` would fail to parse frequency strings starting with "LWOM" (:issue:`59218`) - Bug in :meth:`DataFrame.fillna` raising an ``AssertionError`` instead of ``OutOfBoundsDatetime`` when filling a ``datetime64[ns]`` column with an out-of-bounds timestamp. Now correctly raises ``OutOfBoundsDatetime``. (:issue:`61208`) @@ -971,7 +972,6 @@ Datetimelike - Bug in constructing arrays with :class:`ArrowDtype` with ``timestamp`` type incorrectly allowing ``Decimal("NaN")`` (:issue:`61773`) - Bug in constructing arrays with a timezone-aware :class:`ArrowDtype` from timezone-naive datetime objects incorrectly treating those as UTC times instead of wall times like :class:`DatetimeTZDtype` (:issue:`61775`) - Bug in setting scalar values with mismatched resolution into arrays with non-nanosecond ``datetime64``, ``timedelta64`` or :class:`DatetimeTZDtype` incorrectly truncating those scalars (:issue:`56410`) -- Bug in :func:`to_datetime` where passing an ``lxml.etree._ElementUnicodeResult`` together with ``format`` raised ``TypeError``. Now subclasses of ``str`` are handled. (:issue:`60933`) Timedelta