Skip to content

Commit 469e28d

Browse files
committed
added test
1 parent 0ce5571 commit 469e28d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/tests/series/methods/test_map.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,3 +604,11 @@ def test_map_kwargs():
604604
result = Series([2, 4, 5]).map(lambda x, y: x + y, y=2)
605605
expected = Series([4, 6, 7])
606606
tm.assert_series_equal(result, expected)
607+
608+
def test_map_arrow_timestamp_dict():
609+
# GH 61231
610+
ser = pd.Series(pd.date_range("2023-01-01", periods=3)).astype("timestamp[ns][pyarrow]")
611+
mapper = {ts: i for i, ts in enumerate(ser)}
612+
result = ser.map(mapper)
613+
expected = pd.Series([0, 1, 2], dtype="int64")
614+
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)