File tree Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Expand file tree Collapse file tree 2 files changed +3
-9
lines changed Original file line number Diff line number Diff line change 46
46
from pandas .errors import IntCastingNaNError
47
47
from pandas .util ._decorators import Appender
48
48
49
- from pandas .core .dtypes .cast import (
50
- LossySetitemError ,
51
- maybe_upcast_numeric_to_64bit ,
52
- )
49
+ from pandas .core .dtypes .cast import LossySetitemError
53
50
from pandas .core .dtypes .common import (
54
51
is_categorical_dtype ,
55
52
is_dtype_equal ,
@@ -1791,5 +1788,6 @@ def _maybe_convert_platform_interval(values) -> ArrayLike:
1791
1788
1792
1789
if not hasattr (values , "dtype" ):
1793
1790
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 )
1795
1793
return values
Original file line number Diff line number Diff line change 53
53
ensure_int64 ,
54
54
ensure_object ,
55
55
ensure_str ,
56
- is_array_like ,
57
56
is_bool ,
58
57
is_bool_dtype ,
59
58
is_complex ,
@@ -427,9 +426,6 @@ def maybe_upcast_numeric_to_64bit(arr: NumpyIndexT) -> NumpyIndexT:
427
426
-------
428
427
ndarray or ExtensionArray
429
428
"""
430
-
431
- if not is_array_like (arr ):
432
- return arr
433
429
dtype = arr .dtype
434
430
if not np .issubclass_ (dtype .type , np .number ):
435
431
return arr
You can’t perform that action at this time.
0 commit comments