Skip to content

BUG: Fix groupby quantile segfault #27826

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
Aug 12, 2019

Conversation

TomAugspurger
Copy link
Contributor

Validate that q is between 0 and 1.

Closes #27470

Validate that q is between 0 and 1.

Closes pandas-dev#27470
@TomAugspurger TomAugspurger added this to the 0.25.1 milestone Aug 8, 2019
@TomAugspurger TomAugspurger added Segfault Non-Recoverable Error Groupby labels Aug 8, 2019
@@ -719,6 +719,11 @@ def group_quantile(ndarray[float64_t] out,
ndarray[int64_t] counts, non_na_counts, sort_arr

assert values.shape[0] == N

if q < 0 or q > 1:
Copy link
Member

Choose a reason for hiding this comment

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

can this be not 0 <= q <= 1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like it works with parens.

@jbrockmendel
Copy link
Member

LGTM

@jbrockmendel jbrockmendel self-requested a review August 9, 2019 15:45
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.

lgtm

@jbrockmendel jbrockmendel merged commit 9fd432b into pandas-dev:master Aug 12, 2019
@jbrockmendel
Copy link
Member

Thanks @TomAugspurger

quintusdias pushed a commit to quintusdias/pandas_dev that referenced this pull request Aug 16, 2019
* BUG: Fix groupby quantile segfault

Validate that q is between 0 and 1.

Closes pandas-dev#27470

* prettier
@TomAugspurger TomAugspurger deleted the 27470-quantile-segfault branch August 28, 2019 14:20
@WillAyd
Copy link
Member

WillAyd commented Oct 31, 2019

Going through the 0.25.3 release the test for this showed up in the diff while cherry-picking. On a second review I don't think this was fully back ported (?). I see the whatsnew note but not the test or the changes to groupby.pyx

Unless I am overlooking something should I pick this up for the 0.25.3 release as well?

WillAyd pushed a commit to WillAyd/pandas that referenced this pull request Oct 31, 2019
* BUG: Fix groupby quantile segfault

Validate that q is between 0 and 1.

Closes pandas-dev#27470

* prettier
@WillAyd WillAyd mentioned this pull request Oct 31, 2019
jreback pushed a commit that referenced this pull request Oct 31, 2019
* Backport PR #27826 for 0.25.3 release

* BUG: Fix groupby quantile segfault

Validate that q is between 0 and 1.

Closes #27470

* prettier

* Backport PR #29173 for 0.25.3 release

* Backport PR #29296 for 0.25.3 release

* Backport PR #29294 for 0.25.3 whatsnew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Groupby Segfault Non-Recoverable Error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Groupby.quantile segfaults for quantile > 1
4 participants