File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -213,7 +213,7 @@ def construct_array_type(cls) -> type_t[ExtensionArray]:
213
213
raise NotImplementedError
214
214
215
215
@classmethod
216
- def construct_from_string (cls , string : str ) -> ExtensionDtype :
216
+ def construct_from_string (cls , string : str ):
217
217
r"""
218
218
Construct this type from a string.
219
219
@@ -424,7 +424,7 @@ def register(self, dtype: type[ExtensionDtype]) -> None:
424
424
425
425
self .dtypes .append (dtype )
426
426
427
- def find (self , dtype : type [E ] | E | str ) -> type [E ] | E | ExtensionDtype | None :
427
+ def find (self , dtype : type [ExtensionDtype ] | str ) -> type [ExtensionDtype ] | None :
428
428
"""
429
429
Parameters
430
430
----------
@@ -435,9 +435,8 @@ def find(self, dtype: type[E] | E | str) -> type[E] | E | ExtensionDtype | None:
435
435
return the first matching dtype, otherwise return None
436
436
"""
437
437
if not isinstance (dtype , str ):
438
- if isinstance (dtype , type ):
439
- dtype_type = dtype
440
- else :
438
+ dtype_type = dtype
439
+ if not isinstance (dtype , type ):
441
440
dtype_type = type (dtype )
442
441
if issubclass (dtype_type , ExtensionDtype ):
443
442
return dtype
You can’t perform that action at this time.
0 commit comments