-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
BUG: Fix groupby quantile segfault #27826
Conversation
Validate that q is between 0 and 1. Closes pandas-dev#27470
pandas/_libs/groupby.pyx
Outdated
@@ -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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
LGTM |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Thanks @TomAugspurger |
* BUG: Fix groupby quantile segfault Validate that q is between 0 and 1. Closes pandas-dev#27470 * prettier
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? |
* BUG: Fix groupby quantile segfault Validate that q is between 0 and 1. Closes pandas-dev#27470 * prettier
Validate that q is between 0 and 1.
Closes #27470