From 83f3a558b6ded5d35da6b598e92fa328116c2233 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sun, 18 Feb 2024 22:40:06 +0100 Subject: [PATCH 1/4] DOC: Add a few deprecation notes --- pandas/core/dtypes/common.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index 8eee15e13791a..cfb3ca2b38b6f 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -172,6 +172,9 @@ def is_sparse(arr) -> bool: Returns True if it is a pandas sparse array, not another type of sparse array. + .. deprecated:: 2.1.0 + Use isinstance(dtype, pd.SparseDtype) instead. + Parameters ---------- arr : array-like @@ -294,6 +297,9 @@ def is_datetime64tz_dtype(arr_or_dtype) -> bool: """ Check whether an array-like or dtype is of a DatetimeTZDtype dtype. + .. deprecated:: 2.1.0 + Use isinstance(dtype, pd.DatetimeTZDtype) instead. + Parameters ---------- arr_or_dtype : array-like or dtype @@ -380,6 +386,9 @@ def is_period_dtype(arr_or_dtype) -> bool: """ Check whether an array-like or dtype is of the Period dtype. + .. deprecated:: 2.2.0 + Use isinstance(dtype, pd.Period) instead. + Parameters ---------- arr_or_dtype : array-like or dtype @@ -423,6 +432,9 @@ def is_interval_dtype(arr_or_dtype) -> bool: """ Check whether an array-like or dtype is of the Interval dtype. + .. deprecated:: 2.2.0 + Use isinstance(dtype, pd.IntervalDtype) instead. + Parameters ---------- arr_or_dtype : array-like or dtype @@ -469,6 +481,9 @@ def is_categorical_dtype(arr_or_dtype) -> bool: """ Check whether an array-like or dtype is of the Categorical dtype. + .. deprecated:: 2.2.0 + Use isinstance(dtype, pd.CategoricalDtype) instead. + Parameters ---------- arr_or_dtype : array-like or dtype From 55f8a40a18f6e604d06051f794d6473cc8192d66 Mon Sep 17 00:00:00 2001 From: Thomas Li <47963215+lithomas1@users.noreply.github.com> Date: Mon, 19 Feb 2024 13:10:07 -0500 Subject: [PATCH 2/4] Update common.py --- pandas/core/dtypes/common.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index cfb3ca2b38b6f..fc8fb92c58ced 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -167,13 +167,14 @@ def is_object_dtype(arr_or_dtype) -> bool: def is_sparse(arr) -> bool: """ Check whether an array-like is a 1-D pandas sparse array. + + .. deprecated:: 2.1.0 + Use isinstance(dtype, pd.SparseDtype) instead. Check that the one-dimensional array-like is a pandas sparse array. Returns True if it is a pandas sparse array, not another type of sparse array. - .. deprecated:: 2.1.0 - Use isinstance(dtype, pd.SparseDtype) instead. Parameters ---------- From 33d6e529770e145af9bd355ee7d81a14c430f801 Mon Sep 17 00:00:00 2001 From: Thomas Li <47963215+lithomas1@users.noreply.github.com> Date: Mon, 19 Feb 2024 13:10:30 -0500 Subject: [PATCH 3/4] Update common.py --- pandas/core/dtypes/common.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index fc8fb92c58ced..0ce525b1dd8fe 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -175,7 +175,6 @@ def is_sparse(arr) -> bool: Returns True if it is a pandas sparse array, not another type of sparse array. - Parameters ---------- arr : array-like From e27ff84ab5514e6044d67ffdf9206cbfe0d605b1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 18:54:08 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pandas/core/dtypes/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index 0ce525b1dd8fe..15c51b98aea0b 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -167,7 +167,7 @@ def is_object_dtype(arr_or_dtype) -> bool: def is_sparse(arr) -> bool: """ Check whether an array-like is a 1-D pandas sparse array. - + .. deprecated:: 2.1.0 Use isinstance(dtype, pd.SparseDtype) instead.