Skip to content

Commit d13fb8d

Browse files
samukwekuZeroto521
authored andcommitted
add fix for GH#1184
1 parent bec7293 commit d13fb8d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/timeseries/test_fill_missing_timestamps.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,16 @@ def test_fill_missing_timestamps(timeseries_dataframe):
2626
df1 = timeseries_dataframe.drop(timeseries_dataframe.index[random_number])
2727

2828
# Fill missing timestamps
29-
result = fill_missing_timestamps(df1, frequency="1H")
29+
# fix for GH#1184 is to use the start and end from
30+
# timeseries_dataframe
31+
# imagine that the last row of df1 is removed, or the first entry
32+
# the length check in the next line will fail
33+
result = fill_missing_timestamps(
34+
df1,
35+
frequency="1H",
36+
first_time_stamp=timeseries_dataframe.index.min(),
37+
last_time_stamp=timeseries_dataframe.index.max(),
38+
)
3039

3140
# Testing if the missing timestamp has been filled
3241
assert len(result) == len(timeseries_dataframe)

0 commit comments

Comments
 (0)