Skip to content

Commit 7be93b8

Browse files
jbrockmendelJulianWgs
authored andcommitted
REF: avoid maybe_convert_platform (pandas-dev#41709)
1 parent 629b9b7 commit 7be93b8

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

pandas/core/arrays/interval.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
from pandas.compat.numpy import function as nv
3333
from pandas.util._decorators import Appender
3434

35-
from pandas.core.dtypes.cast import maybe_convert_platform
3635
from pandas.core.dtypes.common import (
3736
is_categorical_dtype,
3837
is_datetime64_dtype,
@@ -1650,4 +1649,6 @@ def _maybe_convert_platform_interval(values) -> ArrayLike:
16501649
else:
16511650
values = extract_array(values, extract_numpy=True)
16521651

1653-
return maybe_convert_platform(values)
1652+
if not hasattr(values, "dtype"):
1653+
return np.asarray(values)
1654+
return values

pandas/core/internals/construction.py

-3
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,6 @@ def _prep_ndarray(values, copy: bool = True) -> np.ndarray:
537537
def convert(v):
538538
if not is_list_like(v) or isinstance(v, ABCDataFrame):
539539
return v
540-
elif not hasattr(v, "dtype") and not isinstance(v, (list, tuple, range)):
541-
# TODO: should we cast these to list?
542-
return v
543540

544541
v = extract_array(v, extract_numpy=True)
545542
res = maybe_convert_platform(v)

0 commit comments

Comments
 (0)