-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: quantile segfaults on invalid quantile values #27473
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
Conversation
fixes this here makes sense. is the underlying problem in numpy or in one of our cython functions? |
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.
We do a similar validation for NDFrame input via the _check_percentile
method - if we were to move that to PandasObject to share across NDFrame and GroupBy would that be even simpler?
I think this line is the problem it calculates an index by using the quantile value as a fraction of array length. |
Yeah, |
Let's put the check in the cython function, so as to preclude any chance of the segfault showing up, e.g. if we call it from somewhere else |
Logical, but thorny. Is the overall approach in pandas to put input validation in cython in the python caller? could also usea python wrapper which is the only cython caller. @WillAyd suggests reusing Whatever there's agreement on is fine by me. |
what is thorny about it? I haven't looked at this too specifically, just in principle would rather segfault-prevention happen as close to the fault as possible |
blocked by #27526 |
waiting for #27584 |
This was a simple fix, but it now depends on too many other small things. I'm sure someone else will get it eventually. |
check_percentiles
out ofNDFrame
)Groupby.quantile
with functionality regression)