Skip to content

Commit a5de269

Browse files
author
analyticalmonk
committed
BUG: Raise when invalid dtype passed to pandas_dtype
Changes made to pandas_dtype() in pandas/core/dtypes/common.py
1 parent 7703f02 commit a5de269

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)