Skip to content

BUG: Offset-based rolling window, with only one raw in dataframe and closed='left', max and min functions make python crash #24811

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 18, 2019

Conversation

jh-wu
Copy link
Contributor

@jh-wu jh-wu commented Jan 17, 2019

@codecov
Copy link

codecov bot commented Jan 17, 2019

Codecov Report

Merging #24811 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #24811   +/-   ##
=======================================
  Coverage   92.38%   92.38%           
=======================================
  Files         166      166           
  Lines       52382    52382           
=======================================
  Hits        48395    48395           
  Misses       3987     3987
Flag Coverage Δ
#multiple 90.81% <ø> (ø) ⬆️
#single 42.92% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17a6bc5...417ca64. Read the comment docs.

@codecov
Copy link

codecov bot commented Jan 17, 2019

Codecov Report

Merging #24811 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24811      +/-   ##
==========================================
- Coverage   92.38%   92.38%   -0.01%     
==========================================
  Files         166      166              
  Lines       52382    52379       -3     
==========================================
- Hits        48395    48391       -4     
- Misses       3987     3988       +1
Flag Coverage Δ
#multiple 90.81% <ø> (-0.01%) ⬇️
#single 42.91% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/util/testing.py 88.04% <0%> (-0.1%) ⬇️
pandas/core/indexes/timedeltas.py 90.22% <0%> (-0.03%) ⬇️
pandas/core/computation/pytables.py 92.35% <0%> (-0.03%) ⬇️
pandas/core/dtypes/cast.py 88.7% <0%> (-0.02%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17a6bc5...2e513db. Read the comment docs.

@jschendel jschendel added Bug Window rolling, ewma, expanding labels Jan 17, 2019
Copy link
Member

@jschendel jschendel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you add a whatsnew entry to doc/source/whatsnew/v0.24.0.rst. The Groupby/Resample/Rolling section for bug fixes starts around line 1808.

@jh-wu
Copy link
Contributor Author

jh-wu commented Jan 17, 2019

Hi @jschendel, no worries. The entry has been added now.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Traveling at the moment hope to review in more detail over the next day or two

@@ -1808,6 +1808,7 @@ Plotting
Groupby/Resample/Rolling
^^^^^^^^^^^^^^^^^^^^^^^^

- Bug in :func:`pandas.core.window.Rolling.min` and :func:`pandas.core.window.Rolling.max` with ``closed='left'``, a datetime-like index and only one entry in the series leading to segfault (:issue:`24718`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this truly this specific? Off the top of my head seems strange that this would only be applicable to date time like indices

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The datetime-like index makes the program going into the function _roll_min_max_variable of window.pyx, where the bug is. I am not very sure if there is any other case triggering the function. But the program normally goes into _roll_min_max_fixed if it isn't a datetime-like index.

@jreback jreback changed the title BUG: GH24718 fixed BUG: Offset-based rolling window, with only one raw in dataframe and closed='left', max and min functions make python crash Jan 17, 2019
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is fine. minor comment.

@jreback jreback added this to the 0.24.0 milestone Jan 17, 2019
@jreback jreback merged commit 2bbe418 into pandas-dev:master Jan 18, 2019
@jreback
Copy link
Contributor

jreback commented Jan 18, 2019

thanks @jh-wu

@jh-wu jh-wu deleted the gh24718 branch January 21, 2019 23:18
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
…closed='left', max and min functions make python crash (pandas-dev#24811)
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
…closed='left', max and min functions make python crash (pandas-dev#24811)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Window rolling, ewma, expanding
Projects
None yet
5 participants