Skip to content

Commit 8cc670a

Browse files
committed
update
1 parent 471362b commit 8cc670a

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

pandas/core/arrays/interval.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,7 @@
4646
from pandas.errors import IntCastingNaNError
4747
from pandas.util._decorators import Appender
4848

49-
from pandas.core.dtypes.cast import (
50-
LossySetitemError,
51-
maybe_upcast_numeric_to_64bit,
52-
)
49+
from pandas.core.dtypes.cast import LossySetitemError
5350
from pandas.core.dtypes.common import (
5451
is_categorical_dtype,
5552
is_dtype_equal,
@@ -1791,5 +1788,6 @@ def _maybe_convert_platform_interval(values) -> ArrayLike:
17911788

17921789
if not hasattr(values, "dtype"):
17931790
values = np.asarray(values)
1794-
values = maybe_upcast_numeric_to_64bit(values)
1791+
if is_integer_dtype(values) and values.dtype != np.int64:
1792+
values = values.astype(np.int64)
17951793
return values

pandas/core/dtypes/cast.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
ensure_int64,
5454
ensure_object,
5555
ensure_str,
56-
is_array_like,
5756
is_bool,
5857
is_bool_dtype,
5958
is_complex,
@@ -427,9 +426,6 @@ def maybe_upcast_numeric_to_64bit(arr: NumpyIndexT) -> NumpyIndexT:
427426
-------
428427
ndarray or ExtensionArray
429428
"""
430-
431-
if not is_array_like(arr):
432-
return arr
433429
dtype = arr.dtype
434430
if not np.issubclass_(dtype.type, np.number):
435431
return arr

0 commit comments

Comments
 (0)