From 747f4805e39839f87c7b24ea7df220e0057cb6fe Mon Sep 17 00:00:00 2001 From: Chilin Chiou Date: Sat, 19 Apr 2025 17:07:13 +0800 Subject: [PATCH 1/4] ENH: add tzdata to the _hard_dependencies --- pandas/__init__.py | 2 +- pandas/tests/test_downstream.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/__init__.py b/pandas/__init__.py index 5dc6a8c3bc50c..7d6dd7b7c1a88 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -3,7 +3,7 @@ __docformat__ = "restructuredtext" # Let users know if they're missing any of our hard dependencies -_hard_dependencies = ("numpy", "dateutil") +_hard_dependencies = ("numpy", "dateutil", "tzdata") for _dependency in _hard_dependencies: try: diff --git a/pandas/tests/test_downstream.py b/pandas/tests/test_downstream.py index 6282aecdfe977..d647ffadb315e 100644 --- a/pandas/tests/test_downstream.py +++ b/pandas/tests/test_downstream.py @@ -187,7 +187,7 @@ def test_yaml_dump(df): tm.assert_frame_equal(df, loaded2) -@pytest.mark.parametrize("dependency", ["numpy", "dateutil"]) +@pytest.mark.parametrize("dependency", ["numpy", "dateutil", "tzdata"]) def test_missing_required_dependency(monkeypatch, dependency): # GH#61030 original_import = __import__ From aa9a8a2f7cc0e302cc072fa399d67cec39fe9fba Mon Sep 17 00:00:00 2001 From: Chilin Chiou Date: Sat, 19 Apr 2025 17:09:59 +0800 Subject: [PATCH 2/4] Add github issue number into test comment --- pandas/tests/test_downstream.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/test_downstream.py b/pandas/tests/test_downstream.py index d647ffadb315e..a7b1c56ff4df2 100644 --- a/pandas/tests/test_downstream.py +++ b/pandas/tests/test_downstream.py @@ -189,7 +189,7 @@ def test_yaml_dump(df): @pytest.mark.parametrize("dependency", ["numpy", "dateutil", "tzdata"]) def test_missing_required_dependency(monkeypatch, dependency): - # GH#61030 + # GH#61030, GH61273 original_import = __import__ mock_error = ImportError(f"Mock error for {dependency}") From 33bfc31fdde41b843958b6abed8d72eb9a25c8f7 Mon Sep 17 00:00:00 2001 From: Chilin Chiou Date: Sat, 19 Apr 2025 19:42:55 +0800 Subject: [PATCH 3/4] Update whatsnew v3.0.0.rst --- doc/source/whatsnew/v3.0.0.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/whatsnew/v3.0.0.rst b/doc/source/whatsnew/v3.0.0.rst index b03b2305172a7..953a9685e50ae 100644 --- a/doc/source/whatsnew/v3.0.0.rst +++ b/doc/source/whatsnew/v3.0.0.rst @@ -77,6 +77,7 @@ Other enhancements - :meth:`pandas.concat` will raise a ``ValueError`` when ``ignore_index=True`` and ``keys`` is not ``None`` (:issue:`59274`) - :py:class:`frozenset` elements in pandas objects are now natively printed (:issue:`60690`) - Add ``"delete_rows"`` option to ``if_exists`` argument in :meth:`DataFrame.to_sql` deleting all records of the table before inserting data (:issue:`37210`). +- Added ``tzdata`` to the ``_hard_dependencies`` (:issue:`61273`) - Added half-year offset classes :class:`HalfYearBegin`, :class:`HalfYearEnd`, :class:`BHalfYearBegin` and :class:`BHalfYearEnd` (:issue:`60928`) - Errors occurring during SQL I/O will now throw a generic :class:`.DatabaseError` instead of the raw Exception type from the underlying driver manager library (:issue:`60748`) - Implemented :meth:`Series.str.isascii` and :meth:`Series.str.isascii` (:issue:`59091`) From 1955b0556a2e533b2efb9ecab1d4b1a8360b253c Mon Sep 17 00:00:00 2001 From: Chilin Chiou Date: Tue, 22 Apr 2025 00:27:51 +0800 Subject: [PATCH 4/4] Remove change content from whatsnew v3.0.0.rst --- doc/source/whatsnew/v3.0.0.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/whatsnew/v3.0.0.rst b/doc/source/whatsnew/v3.0.0.rst index e9b795c01b76f..7c9d78acc0feb 100644 --- a/doc/source/whatsnew/v3.0.0.rst +++ b/doc/source/whatsnew/v3.0.0.rst @@ -77,7 +77,6 @@ Other enhancements - :meth:`pandas.concat` will raise a ``ValueError`` when ``ignore_index=True`` and ``keys`` is not ``None`` (:issue:`59274`) - :py:class:`frozenset` elements in pandas objects are now natively printed (:issue:`60690`) - Add ``"delete_rows"`` option to ``if_exists`` argument in :meth:`DataFrame.to_sql` deleting all records of the table before inserting data (:issue:`37210`). -- Added ``tzdata`` to the ``_hard_dependencies`` (:issue:`61273`) - Added half-year offset classes :class:`HalfYearBegin`, :class:`HalfYearEnd`, :class:`BHalfYearBegin` and :class:`BHalfYearEnd` (:issue:`60928`) - Errors occurring during SQL I/O will now throw a generic :class:`.DatabaseError` instead of the raw Exception type from the underlying driver manager library (:issue:`60748`) - Implemented :meth:`Series.str.isascii` and :meth:`Series.str.isascii` (:issue:`59091`)