Skip to content

fix(data): assign sort_index() result in filter.py#2166

Open
warren618 wants to merge 1 commit intomicrosoft:mainfrom
warren618:fix/filter-sort-index
Open

fix(data): assign sort_index() result in filter.py#2166
warren618 wants to merge 1 commit intomicrosoft:mainfrom
warren618:fix/filter-sort-index

Conversation

@warren618
Copy link

Summary

Fixes #2165

timestamp_series.sort_index() in filter.py:163 discards the return value. Since pandas.Series.sort_index() is not in-place by default, the series remains unsorted, potentially producing incorrect timestamp ranges.

Change

- timestamp_series.sort_index()
+ timestamp_series = timestamp_series.sort_index()

One line, one file.

pandas Series.sort_index() returns a new sorted Series and does not
modify in place. The return value was being discarded, so the
timestamp_series fed into the iteration loop could be unsorted,
producing incorrect timestamp ranges for filtered instruments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: sort_index() result discarded in filter.py — timestamp series may be unsorted

1 participant