Skip to content

Commit 5b7d2a3

Browse files
author
analyticalmonk
committed
Raise when invalid dtype passed to pandas_dtype
Changes made to pandas_dtype() in pandas/core/dtypes/common.py
1 parent 8262133 commit 5b7d2a3

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
@@ -737,5 +737,7 @@ def pandas_dtype(dtype):
737737
pass
738738
elif isinstance(dtype, ExtensionDtype):
739739
return dtype
740+
elif np.dtype(dtype).kind == 'O':
741+
raise TypeError("data type {0} not understood".format(dtype))
740742

741743
return np.dtype(dtype)

0 commit comments

Comments
 (0)