Skip to content

Commit f72c7e6

Browse files
input is always EA
1 parent 0710ea4 commit f72c7e6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pandas/core/arrays/_utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515

1616
if TYPE_CHECKING:
1717
from pandas._typing import (
18-
ArrayLike,
1918
npt,
2019
)
2120

21+
from pandas.core.arrays.base import ExtensionArray
22+
2223

2324
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
2526
) -> tuple[np.dtype | None, Any]:
2627
result_dtype: np.dtype | None
2728
inferred_numeric_dtype = False
@@ -34,11 +35,11 @@ def to_numpy_dtype_inference(
3435
if arr.dtype.kind in "iu":
3536
result_dtype = np.dtype(np.float64)
3637
else:
37-
result_dtype = arr.dtype.numpy_dtype # type: ignore[union-attr]
38+
result_dtype = arr.dtype.numpy_dtype # type: ignore[attr-defined]
3839
if na_value is lib.no_default:
3940
na_value = np.nan
4041
else:
41-
result_dtype = arr.dtype.numpy_dtype # type: ignore[union-attr]
42+
result_dtype = arr.dtype.numpy_dtype # type: ignore[attr-defined]
4243
elif dtype is not None:
4344
result_dtype = np.dtype(dtype)
4445
else:

0 commit comments

Comments
 (0)