From de2e5d1081ddd3724b63f59f0d2b5e81482d2f59 Mon Sep 17 00:00:00 2001 From: gfyoung Date: Thu, 11 Jan 2018 02:09:13 -0800 Subject: [PATCH] CLN: Remove pandas.util | tools/hashing.py Deprecated in v0.20.0 xref gh-16223 --- doc/source/whatsnew/v0.23.0.txt | 1 + pandas/tests/util/test_hashing.py | 15 --------------- pandas/tools/hashing.py | 18 ------------------ pandas/util/hashing.py | 18 ------------------ 4 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 pandas/tools/hashing.py delete mode 100644 pandas/util/hashing.py diff --git a/doc/source/whatsnew/v0.23.0.txt b/doc/source/whatsnew/v0.23.0.txt index 92eeed89ada2a..dc305f36f32ec 100644 --- a/doc/source/whatsnew/v0.23.0.txt +++ b/doc/source/whatsnew/v0.23.0.txt @@ -317,6 +317,7 @@ Removal of prior version deprecations/changes - The options ``display.line_with`` and ``display.height`` are removed in favor of ``display.width`` and ``display.max_rows`` respectively (:issue:`4391`, :issue:`19107`) - The ``labels`` attribute of the ``Categorical`` class has been removed in favor of :attribute:`Categorical.codes` (:issue:`7768`) - The ``flavor`` parameter have been removed from func:`to_sql` method (:issue:`13611`) +- The modules `pandas.tools.hashing` and `pandas.util.hashing` have been removed (:issue:`16223`) .. _whatsnew_0230.performance: diff --git a/pandas/tests/util/test_hashing.py b/pandas/tests/util/test_hashing.py index 289592939e3da..fe8d75539879e 100644 --- a/pandas/tests/util/test_hashing.py +++ b/pandas/tests/util/test_hashing.py @@ -290,18 +290,3 @@ def test_hash_collisions(self): result = hash_array(np.asarray(L, dtype=object), 'utf8') tm.assert_numpy_array_equal( result, np.concatenate([expected1, expected2], axis=0)) - - -def test_deprecation(): - - with tm.assert_produces_warning(DeprecationWarning, - check_stacklevel=False): - from pandas.tools.hashing import hash_pandas_object - obj = Series(list('abc')) - hash_pandas_object(obj, hash_key='9876543210123456') - - with tm.assert_produces_warning(DeprecationWarning, - check_stacklevel=False): - from pandas.tools.hashing import hash_array - obj = np.array([1, 2, 3]) - hash_array(obj, hash_key='9876543210123456') diff --git a/pandas/tools/hashing.py b/pandas/tools/hashing.py deleted file mode 100644 index ba38710b607af..0000000000000 --- a/pandas/tools/hashing.py +++ /dev/null @@ -1,18 +0,0 @@ -import warnings -import sys - -m = sys.modules['pandas.tools.hashing'] -for t in ['hash_pandas_object', 'hash_array']: - - def outer(t=t): - - def wrapper(*args, **kwargs): - from pandas import util - warnings.warn("pandas.tools.hashing is deprecated and will be " - "removed in a future version, import " - "from pandas.util", - DeprecationWarning, stacklevel=3) - return getattr(util, t)(*args, **kwargs) - return wrapper - - setattr(m, t, outer(t)) diff --git a/pandas/util/hashing.py b/pandas/util/hashing.py deleted file mode 100644 index f97a7ac507407..0000000000000 --- a/pandas/util/hashing.py +++ /dev/null @@ -1,18 +0,0 @@ -import warnings -import sys - -m = sys.modules['pandas.util.hashing'] -for t in ['hash_pandas_object', 'hash_array']: - - def outer(t=t): - - def wrapper(*args, **kwargs): - from pandas import util - warnings.warn("pandas.util.hashing is deprecated and will be " - "removed in a future version, import " - "from pandas.util", - DeprecationWarning, stacklevel=3) - return getattr(util, t)(*args, **kwargs) - return wrapper - - setattr(m, t, outer(t))