Skip to content

Commit e50d7a3

Browse files
okz12proost
authored andcommitted
TST: Apply method broken for empty integer series with datetime index (pandas-dev#29358)
1 parent 292d921 commit e50d7a3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/series/test_apply.py

+6
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ def test_apply_categorical_with_nan_values(self, series):
170170
expected = expected.astype(object)
171171
tm.assert_series_equal(result, expected)
172172

173+
def test_apply_empty_integer_series_with_datetime_index(self):
174+
# GH 21245
175+
s = pd.Series([], index=pd.date_range(start="2018-01-01", periods=0), dtype=int)
176+
result = s.apply(lambda x: x)
177+
tm.assert_series_equal(result, s)
178+
173179

174180
class TestSeriesAggregate:
175181
def test_transform(self, string_series):

0 commit comments

Comments
 (0)