File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 15
15
16
16
if TYPE_CHECKING :
17
17
from pandas ._typing import (
18
- ArrayLike ,
19
18
npt ,
20
19
)
21
20
21
+ from pandas .core .arrays .base import ExtensionArray
22
+
22
23
23
24
def to_numpy_dtype_inference (
24
- arr : ArrayLike , dtype : npt .DTypeLike | None , na_value , hasna : bool
25
+ arr : ExtensionArray , dtype : npt .DTypeLike | None , na_value , hasna : bool
25
26
) -> tuple [np .dtype | None , Any ]:
26
27
result_dtype : np .dtype | None
27
28
inferred_numeric_dtype = False
@@ -34,11 +35,11 @@ def to_numpy_dtype_inference(
34
35
if arr .dtype .kind in "iu" :
35
36
result_dtype = np .dtype (np .float64 )
36
37
else :
37
- result_dtype = arr .dtype .numpy_dtype # type: ignore[union- attr]
38
+ result_dtype = arr .dtype .numpy_dtype # type: ignore[attr-defined ]
38
39
if na_value is lib .no_default :
39
40
na_value = np .nan
40
41
else :
41
- result_dtype = arr .dtype .numpy_dtype # type: ignore[union- attr]
42
+ result_dtype = arr .dtype .numpy_dtype # type: ignore[attr-defined ]
42
43
elif dtype is not None :
43
44
result_dtype = np .dtype (dtype )
44
45
else :
You can’t perform that action at this time.
0 commit comments