From d5e51735853ef58a3514431ad960c9f9c69058ec Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Wed, 2 Nov 2016 16:46:44 +0100 Subject: [PATCH 1/2] DEPR: add deprecation warning for com.array_equivalent pandas.core.common.array_equivalent was removed without deprecation warning. This commits adds it back to the core.common namespace with deprecation warning --- pandas/api/tests/test_api.py | 7 +++++++ pandas/core/common.py | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/pandas/api/tests/test_api.py b/pandas/api/tests/test_api.py index d4d8b7e4e9747..49aa31c375e25 100644 --- a/pandas/api/tests/test_api.py +++ b/pandas/api/tests/test_api.py @@ -1,5 +1,7 @@ # -*- coding: utf-8 -*- +import numpy as np + import pandas as pd from pandas.core import common as com from pandas import api @@ -184,6 +186,11 @@ def test_deprecation_core_common(self): for t in self.allowed: self.check_deprecation(getattr(com, t), getattr(types, t)) + def test_deprecation_core_common_array_equivalent(self): + + with tm.assert_produces_warning(DeprecationWarning): + com.array_equivalent(np.array([1, 2]), np.array([1, 2])) + def test_deprecation_core_common_moved(self): # these are in pandas.types.common diff --git a/pandas/core/common.py b/pandas/core/common.py index 341bd3b4cc845..295947bbc1166 100644 --- a/pandas/core/common.py +++ b/pandas/core/common.py @@ -64,6 +64,15 @@ def wrapper(*args, **kwargs): setattr(m, t, outer(t)) +# deprecate array_equivalent + +def array_equivalent(*args, **kwargs): + warnings.warn("'pandas.core.common.array_equivalent' is deprecated and " + "is no longer public API", DeprecationWarning, stacklevel=2) + from pandas.types import missing + return missing.array_equivalent(*args, **kwargs) + + class PandasError(Exception): pass From f8f919bb611bb66c738140c1dd9ccffc8b0c7d6e Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Thu, 3 Nov 2016 10:35:25 +0100 Subject: [PATCH 2/2] Add whatsnew notice --- doc/source/whatsnew/v0.19.1.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v0.19.1.txt b/doc/source/whatsnew/v0.19.1.txt index 80a3e38fd5edd..cbdacb95a3d4a 100644 --- a/doc/source/whatsnew/v0.19.1.txt +++ b/doc/source/whatsnew/v0.19.1.txt @@ -34,7 +34,7 @@ Bug Fixes ~~~~~~~~~ - Compat with Cython 0.25 for building (:issue:`14496`) - +- Added back ``pandas.core.common.array_equivalent`` with a deprecation warning (:issue:`14555`). - Bug in ``pd.read_csv`` for the C engine in which quotation marks were improperly parsed in skipped rows (:issue:`14459`) - Bug in ``pd.read_csv`` for Python 2.x in which Unicode quote characters were no longer being respected (:issue:`14477`)