Skip to content

Commit

Permalink
[TST] Fix for Issue #1184 (#1186)
Browse files Browse the repository at this point in the history
* add fix for GH#1184

* changelog

* fix grammar

* clearer comments

* update changelog

Co-authored-by: Eric Ma <ericmjl@users.noreply.github.com>
  • Loading branch information
samukweku and ericmjl authored Nov 7, 2022
1 parent 32bd2ab commit fe9fa5a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- [TST] Compat with macos and window, to fix `FailedHealthCheck` Issue #1181 @Zeroto521
- [INF] Merge two docs CIs (`docs-preview.yml` and `docs.yml`) to one. And add `documentation` pytest mark. PR #1183 @Zeroto521
- [INF] Merge `codecov.yml` (only works for the dev branch pushing event) into `tests.yml` (only works for PR event). PR #1185 @Zeroto521
- [TST] Fix failure for test/timeseries/test_fill_missing_timestamp. Issue #1184 @samukweku
- [BUG] Import `DataDescription` to fix: `AttributeError: 'DataFrame' object has no attribute 'data_description'`. PR #1191 @Zeroto521

## [v0.23.1] - 2022-05-03
Expand Down
11 changes: 10 additions & 1 deletion tests/timeseries/test_fill_missing_timestamps.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,16 @@ def test_fill_missing_timestamps(timeseries_dataframe):
df1 = timeseries_dataframe.drop(timeseries_dataframe.index[random_number])

# Fill missing timestamps
result = fill_missing_timestamps(df1, frequency="1H")
# fix for GH#1184 is to use the start and end from
# timeseries_dataframe
# imagine that the last row of df1 is removed, or the first entry
# the length check in the assert line will fail
result = fill_missing_timestamps(
df1,
frequency="1H",
first_time_stamp=timeseries_dataframe.index.min(),
last_time_stamp=timeseries_dataframe.index.max(),
)

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

0 comments on commit fe9fa5a

Please sign in to comment.