Skip to content

Commit

Permalink
Fix zillion deprecation warnings in core.dtypes.common (#22142)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrockmendel authored and jreback committed Aug 1, 2018
1 parent 20f7ae8 commit 59c3132
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pandas/core/dtypes/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2016,7 +2016,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 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
elif npdtype.kind == 'O':
raise TypeError("dtype '{}' not understood".format(dtype))
Expand Down

0 comments on commit 59c3132

Please sign in to comment.