Skip to content

Commit 083f705

Browse files
committed
CLN: remove outdated
1 parent f47c746 commit 083f705

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

pandas/core/arrays/arrow/array.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -350,13 +350,7 @@ def _from_sequence_of_strings(
350350

351351
scalars = to_datetime(strings, errors="raise").date
352352

353-
if isinstance(strings, cls):
354-
# Avoid an object path
355-
# TODO: this assumes that pyarrows str->date casting is the
356-
# same as to_datetime. Is that a fair assumption?
357-
scalars = strings._pa_array.cast(pa_type)
358-
else:
359-
scalars = pa.array(scalars, mask=mask.view(bool), type=pa_type)
353+
scalars = pa.array(scalars, mask=mask.view(bool), type=pa_type)
360354

361355
elif pa.types.is_duration(pa_type):
362356
from pandas.core.tools.timedeltas import to_timedelta
@@ -368,9 +362,7 @@ def _from_sequence_of_strings(
368362
# attempt to parse as int64 reflecting pyarrow's
369363
# duration to string casting behavior
370364
mask = isna(scalars)
371-
if isinstance(strings, cls):
372-
strings = strings._pa_array
373-
elif not isinstance(strings, (pa.Array, pa.ChunkedArray)):
365+
if not isinstance(strings, (pa.Array, pa.ChunkedArray)):
374366
strings = pa.array(strings, type=pa.string(), mask=mask)
375367
strings = pc.if_else(mask, None, strings)
376368
try:

pandas/core/arrays/base.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -778,9 +778,6 @@ def astype(self, dtype: AstypeArg, copy: bool = True) -> ArrayLike:
778778

779779
return TimedeltaArray._from_sequence(self, dtype=dtype, copy=copy)
780780

781-
# if dtype.kind == "U":
782-
# dtype = np.dtype(object)
783-
# return self.to_numpy(dtype=dtype, copy=copy)
784781
if not copy:
785782
return np.asarray(self, dtype=dtype)
786783
else:

pandas/tests/extension/base/setitem.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ def test_setitem_frame_2d_values(self, data):
422422
df.iloc[:-1] = df.iloc[:-1].copy()
423423
tm.assert_frame_equal(df, orig)
424424

425-
# FIXME: Breaks for pyarrow float dtype bc df.values changes NAs to NaN
426425
df.iloc[:] = df.values
427426
tm.assert_frame_equal(df, orig)
428427

0 commit comments

Comments
 (0)