Skip to content

Commit ee46751

Browse files
committed
feedback
1 parent e559a1b commit ee46751

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

pandas/core/arrays/arrow/array.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2160,7 +2160,9 @@ def interpolate(
21602160
"""
21612161
# NB: we return type(self) even if copy=False
21622162
if not self.dtype._is_numeric:
2163-
raise ValueError("Values must be numeric.")
2163+
raise NotImplementedError(
2164+
f"interpolate is not implemented for dtype={self.dtype}"
2165+
)
21642166

21652167
if (
21662168
not pa_version_under13p0

pandas/core/frame.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6273,10 +6273,6 @@ class max type
62736273
else:
62746274
to_insert = ((self.index, None),)
62756275

6276-
if len(new_obj.columns) == 0 and names:
6277-
target_dtype = Index(names).dtype
6278-
new_obj.columns = new_obj.columns.astype(target_dtype)
6279-
62806276
multi_col = isinstance(self.columns, MultiIndex)
62816277
for j, (lev, lab) in enumerate(to_insert, start=1):
62826278
i = self.index.nlevels - j

pandas/core/internals/blocks.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,6 +2361,4 @@ def external_values(values: ArrayLike) -> ArrayLike:
23612361
values.flags.writeable = False
23622362

23632363
# TODO(CoW) we should also mark our ExtensionArrays as read-only
2364-
if isinstance(values, ExtensionArray):
2365-
... # this is why test_to_dict_of_blocks_item_cache fails
23662364
return values

pandas/tests/frame/methods/test_astype.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,15 @@ def test_astype_dt64_to_string(
765765
item = item.iloc[0]
766766
if using_infer_string:
767767
assert item is pd.NA
768-
else:
768+
769+
# Check that Series/DataFrame.astype matches DatetimeArray.astype
770+
expected = frame_or_series(dta.astype("str"))
771+
tm.assert_equal(result, expected)
772+
773+
item = result.iloc[0]
774+
if frame_or_series is DataFrame:
775+
item = item.iloc[0]
776+
if using_infer_string:
769777
assert item is np.nan
770778

771779
def test_astype_td64_to_string(self, frame_or_series):

pandas/tests/frame/methods/test_combine_first.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def test_combine_first_mixed(self):
3030
combined = f.combine_first(g)
3131
tm.assert_frame_equal(combined, exp)
3232

33-
def test_combine_first(self, float_frame, using_infer_string):
33+
def test_combine_first(self, float_frame):
3434
# disjoint
3535
head, tail = float_frame[:5], float_frame[5:]
3636

pandas/tests/frame/methods/test_dtypes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,5 +137,5 @@ def test_frame_apply_np_array_return_type(self, using_infer_string):
137137
# GH 35517
138138
df = DataFrame([["foo"]])
139139
result = df.apply(lambda col: np.array("bar"))
140-
expected = Series(np.array(["bar"]), dtype=object)
140+
expected = Series(np.array("bar"))
141141
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)