Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEPR: add deprecation warning for com.array_equivalent #14567

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v0.19.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
7 changes: 7 additions & 0 deletions pandas/api/tests/test_api.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions pandas/core/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down