Skip to content

Commit 093aa82

Browse files
DEPR: add deprecation warning for com.array_equivalent (#14567)
pandas.core.common.array_equivalent was removed without deprecation warning. This commits adds it back to the core.common namespace with deprecation warning
1 parent 1d95179 commit 093aa82

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

doc/source/whatsnew/v0.19.1.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Bug Fixes
3434
~~~~~~~~~
3535

3636
- Compat with Cython 0.25 for building (:issue:`14496`)
37-
37+
- Added back ``pandas.core.common.array_equivalent`` with a deprecation warning (:issue:`14555`).
3838

3939
- Bug in ``pd.read_csv`` for the C engine in which quotation marks were improperly parsed in skipped rows (:issue:`14459`)
4040
- Bug in ``pd.read_csv`` for Python 2.x in which Unicode quote characters were no longer being respected (:issue:`14477`)

pandas/api/tests/test_api.py

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# -*- coding: utf-8 -*-
22

3+
import numpy as np
4+
35
import pandas as pd
46
from pandas.core import common as com
57
from pandas import api
@@ -184,6 +186,11 @@ def test_deprecation_core_common(self):
184186
for t in self.allowed:
185187
self.check_deprecation(getattr(com, t), getattr(types, t))
186188

189+
def test_deprecation_core_common_array_equivalent(self):
190+
191+
with tm.assert_produces_warning(DeprecationWarning):
192+
com.array_equivalent(np.array([1, 2]), np.array([1, 2]))
193+
187194
def test_deprecation_core_common_moved(self):
188195

189196
# these are in pandas.types.common

pandas/core/common.py

+9
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ def wrapper(*args, **kwargs):
6464
setattr(m, t, outer(t))
6565

6666

67+
# deprecate array_equivalent
68+
69+
def array_equivalent(*args, **kwargs):
70+
warnings.warn("'pandas.core.common.array_equivalent' is deprecated and "
71+
"is no longer public API", DeprecationWarning, stacklevel=2)
72+
from pandas.types import missing
73+
return missing.array_equivalent(*args, **kwargs)
74+
75+
6776
class PandasError(Exception):
6877
pass
6978

0 commit comments

Comments
 (0)