Skip to content
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

[FEA] Throw std::out_of_range exception when an API involving indices includes an index larger than column size #15315

Closed
vyasr opened this issue Mar 15, 2024 · 1 comment · Fixed by #15319
Labels
feature request New feature or request

Comments

@vyasr
Copy link
Contributor

vyasr commented Mar 15, 2024

Is your feature request related to a problem? Please describe.
There are APIs like split and slice where some of the inputs are host-accessible index ranges. In such cases these ranges may represent indices that are out of bounds, and this can be verified without any introspection.

Describe the solution you'd like
Instead of cudf::logic_error, we should throw std::out_of_range exceptions in these cases.

Describe alternatives you've considered
None

Additional context
This proposal does not indicate that we should try to detect out of range indices in APIs like gather or scatter. Those would require introspection of device data, which is out of scope for libcudf, so behavior in those cases remains undefined.

@vyasr vyasr added the feature request New feature or request label Mar 15, 2024
@vyasr
Copy link
Contributor Author

vyasr commented Mar 15, 2024

An example of this new exception usage is in #15319.

rapids-bot bot pushed a commit that referenced this issue Mar 18, 2024
This PR also introduces `std::out_of_range` to cudf's code base in cases where it is appropriate.

Contributes to #12885 
Resolves #15315 
Contributes to #15162

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Bradley Dice (https://github.com/bdice)

URL: #15319
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant