Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add gh refs
  • Loading branch information
phofl committed Nov 16, 2023
commit f93f01b2837f52796ddce8dbd8acd9c2b23070fc
11 changes: 6 additions & 5 deletions pandas/tests/series/indexing/test_setitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,17 +529,18 @@ def test_setitem_empty_series_timestamp_preserves_dtype(self):
Timedelta("9 days").to_pytimedelta(),
],
)
def test_append_timedelta_does_not_cast(self, td, using_infer_string):
def test_append_timedelta_does_not_cast(self, td, using_infer_string, request):
# GH#22717 inserting a Timedelta should _not_ cast to int64
if using_infer_string and not isinstance(td, Timedelta):
# TODO: GH#56009
request.applymarker(pytest.mark.xfail(reason="inferred as string"))

expected = Series(["x", td], index=[0, "td"], dtype=object)

ser = Series(["x"])
ser["td"] = td
tm.assert_series_equal(ser, expected)
if using_infer_string and not isinstance(td, Timedelta):
assert not isinstance(ser["td"], Timedelta)
else:
assert isinstance(ser["td"], Timedelta)
assert isinstance(ser["td"], Timedelta)

ser = Series(["x"])
ser.loc["td"] = Timedelta("9 days")
Expand Down
1 change: 1 addition & 0 deletions pandas/tests/series/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ def test_comparisons(self, using_infer_string):
import pyarrow as pa

msg = "has no kernel"
# TODO(3.0) GH56008
with pytest.raises(pa.lib.ArrowNotImplementedError, match=msg):
s == s2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably return all False in the future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes if we want to patch the arrow behaviour, makes probably sense

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK could you add a TODO here as a reminder? Would be good to include it in an issue referencing things that would need fixing before 3.0

with tm.assert_produces_warning(
Expand Down