Skip to content

Commit a0826e9

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 9fe3a8e commit a0826e9

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
@@ -367,6 +367,8 @@ def is_datetime64_dtype(arr_or_dtype):
367367
tipo = _get_dtype_type(arr_or_dtype)
368368
except TypeError:
369369
return False
370+
except UnicodeEncodeError:
371+
return False
370372
return issubclass(tipo, np.datetime64)
371373

372374

0 commit comments

Comments
 (0)