Skip to content

Commit f14bb38

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 f14bb38

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-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

+10
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
from pandas.types.missing import isnull
2020
from pandas.api import types
2121
from pandas.types import common
22+
from pandas.util.decorators import deprecate
2223

2324
# back-compat of public API
2425
# deprecate these functions
@@ -64,6 +65,15 @@ def wrapper(*args, **kwargs):
6465
setattr(m, t, outer(t))
6566

6667

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

0 commit comments

Comments
 (0)