From e4e5cebf66a7080d65ab76e60fdc24b58f239748 Mon Sep 17 00:00:00 2001 From: Brock Date: Thu, 14 Sep 2023 15:55:01 -0700 Subject: [PATCH] GH ref --- doc/source/whatsnew/v2.2.0.rst | 2 +- pandas/core/internals/__init__.py | 1 + pandas/core/internals/api.py | 1 + pandas/tests/internals/test_api.py | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v2.2.0.rst b/doc/source/whatsnew/v2.2.0.rst index 93c4abad6146d..b1a79527b2378 100644 --- a/doc/source/whatsnew/v2.2.0.rst +++ b/doc/source/whatsnew/v2.2.0.rst @@ -149,6 +149,7 @@ Other API changes Deprecations ~~~~~~~~~~~~ - Changed :meth:`Timedelta.resolution_string` to return ``min``, ``s``, ``ms``, ``us``, and ``ns`` instead of ``T``, ``S``, ``L``, ``U``, and ``N``, for compatibility with respective deprecations in frequency aliases (:issue:`52536`) +- Deprecated ``core.internals`` members ``Block``, ``ExtensionBlock``, ``DatetimeTZBlock``, and ``make_block``, use public APIs instead (:issue:`55139`) - Deprecated allowing non-keyword arguments in :meth:`DataFrame.to_clipboard`. (:issue:`54229`) - Deprecated allowing non-keyword arguments in :meth:`DataFrame.to_csv` except ``path_or_buf``. (:issue:`54229`) - Deprecated allowing non-keyword arguments in :meth:`DataFrame.to_dict`. (:issue:`54229`) @@ -169,7 +170,6 @@ Deprecations - Deprecated strings ``T``, ``S``, ``L``, ``U``, and ``N`` denoting frequencies in :class:`Minute`, :class:`Second`, :class:`Milli`, :class:`Micro`, :class:`Nano` (:issue:`52536`) - Deprecated strings ``T``, ``S``, ``L``, ``U``, and ``N`` denoting units in :class:`Timedelta` (:issue:`52536`) - Deprecated the extension test classes ``BaseNoReduceTests``, ``BaseBooleanReduceTests``, and ``BaseNumericReduceTests``, use ``BaseReduceTests`` instead (:issue:`54663`) -- Deprecated ``core.internals`` members ``Block``, ``ExtensionBlock``, ``DatetimeTZBlock``, and ``make_block``, use public APIs instead (:issue:`??`) - .. --------------------------------------------------------------------------- diff --git a/pandas/core/internals/__init__.py b/pandas/core/internals/__init__.py index 77134bf2667c7..f4c78fe0ac98a 100644 --- a/pandas/core/internals/__init__.py +++ b/pandas/core/internals/__init__.py @@ -31,6 +31,7 @@ def __getattr__(name: str): + # GH#55139 import warnings from pandas.util._exceptions import find_stack_level diff --git a/pandas/core/internals/api.py b/pandas/core/internals/api.py index 4ede7498ec44c..59f6919405c59 100644 --- a/pandas/core/internals/api.py +++ b/pandas/core/internals/api.py @@ -112,6 +112,7 @@ def maybe_infer_ndim(values, placement: BlockPlacement, ndim: int | None) -> int def __getattr__(name: str): + # GH#55139 import warnings from pandas.util._exceptions import find_stack_level diff --git a/pandas/tests/internals/test_api.py b/pandas/tests/internals/test_api.py index bfa639fac9545..7d0797449d9e9 100644 --- a/pandas/tests/internals/test_api.py +++ b/pandas/tests/internals/test_api.py @@ -58,6 +58,7 @@ def test_namespace(): ], ) def test_deprecations(name): + # GH#55139 msg = f"{name} is deprecated.* Use public APIs instead" with tm.assert_produces_warning(DeprecationWarning, match=msg): getattr(internals, name)