Skip to content

Commit d5e5173

Browse files
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
1 parent 1d95179 commit d5e5173

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

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)