Skip to content

Commit 7691c82

Browse files
committed
except unicode in is_datetime64_dtype
is_datetime64_dtype is trying to check the type of unicodes but numpy does not support unicode and this line breaks. Add except error and return false Test for unicode still fails for python 2
1 parent bdad724 commit 7691c82

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/core/dtypes/common.py

+2
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,8 @@ def is_datetime64_dtype(arr_or_dtype):
394394
tipo = _get_dtype_type(arr_or_dtype)
395395
except TypeError:
396396
return False
397+
except UnicodeEncodeError:
398+
return False
397399
return issubclass(tipo, np.datetime64)
398400

399401

0 commit comments

Comments
 (0)