From a332a16a70f89d79102c7573f455cedbe7b468da Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Mon, 30 Jul 2018 20:46:13 -0700 Subject: [PATCH 1/3] fix zillion deprecation warnings --- pandas/core/dtypes/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index 905073645fcb3..15786c3e954a4 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -2023,7 +2023,9 @@ def pandas_dtype(dtype): # also catch some valid dtypes such as object, np.object_ and 'object' # which we safeguard against by catching them earlier and returning # np.dtype(valid_dtype) before this condition is evaluated. - if dtype in [object, np.object_, 'object', 'O']: + if hashable(dtype) and dtype in [object, np.object_, 'object', 'O']: + # check hashability to avoid errors/DeprecationWarning when we get + # here and `dtype` is an array return npdtype elif npdtype.kind == 'O': raise TypeError("dtype '{}' not understood".format(dtype)) From 250bb6c18609e2a3e599decf8652e8036c7418e0 Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Mon, 30 Jul 2018 20:54:20 -0700 Subject: [PATCH 2/3] whitespace fixup --- pandas/core/dtypes/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index 15786c3e954a4..54e8d31c301f2 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -2023,7 +2023,7 @@ def pandas_dtype(dtype): # also catch some valid dtypes such as object, np.object_ and 'object' # which we safeguard against by catching them earlier and returning # np.dtype(valid_dtype) before this condition is evaluated. - if hashable(dtype) and dtype in [object, np.object_, 'object', 'O']: + if hashable(dtype) and dtype in [object, np.object_, 'object', 'O']: # check hashability to avoid errors/DeprecationWarning when we get # here and `dtype` is an array return npdtype From 5d14359493725a2fd32e53f257ceecd72d36281c Mon Sep 17 00:00:00 2001 From: Brock Mendel Date: Tue, 31 Jul 2018 10:39:29 -0700 Subject: [PATCH 3/3] fix py3 hashable nameerror --- pandas/core/dtypes/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/dtypes/common.py b/pandas/core/dtypes/common.py index 54e8d31c301f2..8f7f19c3a0b9f 100644 --- a/pandas/core/dtypes/common.py +++ b/pandas/core/dtypes/common.py @@ -2023,7 +2023,7 @@ def pandas_dtype(dtype): # also catch some valid dtypes such as object, np.object_ and 'object' # which we safeguard against by catching them earlier and returning # np.dtype(valid_dtype) before this condition is evaluated. - if hashable(dtype) and dtype in [object, np.object_, 'object', 'O']: + if is_hashable(dtype) and dtype in [object, np.object_, 'object', 'O']: # check hashability to avoid errors/DeprecationWarning when we get # here and `dtype` is an array return npdtype