Skip to content

Commit db8900c

Browse files
use pandas_dtype() instead of registry.find
1 parent e791330 commit db8900c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pandas/core/dtypes/common.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,10 +1450,11 @@ def is_extension_array_dtype(arr_or_dtype) -> bool:
14501450
elif isinstance(dtype, np.dtype):
14511451
return False
14521452
else:
1453-
# TODO ugly -> move into registry find()? Or make this work with pandas_dtype?
1454-
if dtype is str and using_string_dtype():
1455-
return True
1456-
return registry.find(dtype) is not None
1453+
try:
1454+
dtype = pandas_dtype(dtype)
1455+
except TypeError:
1456+
return False
1457+
return isinstance(dtype, ExtensionDtype)
14571458

14581459

14591460
def is_ea_or_datetimelike_dtype(dtype: DtypeObj | None) -> bool:

0 commit comments

Comments
 (0)