We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db8900c commit e6aad17Copy full SHA for e6aad17
pandas/core/dtypes/common.py
@@ -1451,8 +1451,12 @@ def is_extension_array_dtype(arr_or_dtype) -> bool:
1451
return False
1452
else:
1453
try:
1454
- dtype = pandas_dtype(dtype)
1455
- except TypeError:
+ with warnings.catch_warnings():
+ # pandas_dtype(..) can raise UserWarning for class input
1456
+ warnings.simplefilter("ignore", UserWarning)
1457
+ dtype = pandas_dtype(dtype)
1458
+ except (TypeError, ValueError):
1459
+ # np.dtype(..) can raise ValueError
1460
1461
return isinstance(dtype, ExtensionDtype)
1462
0 commit comments