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 more specific exceptions in libcudf #12885

Open
vyasr opened this issue Mar 6, 2023 · 0 comments
Open

[FEA] Throw more specific exceptions in libcudf #12885

vyasr opened this issue Mar 6, 2023 · 0 comments
Labels
2 - In Progress Currently a work in progress feature request New feature or request libcudf Affects libcudf (C++/CUDA) code.

Comments

@vyasr
Copy link
Contributor

vyasr commented Mar 6, 2023

Is your feature request related to a problem? Please describe.
The discussion in #10200 demonstrated a general desire to have libcudf provide more useful diagnostics of failure modes to users by throwing more informative exceptions for different types of failures instead of always throwing cudf::logic_error. #12426 implemented the necessary scaffolding in cuDF Python and the libcudf JNI to allow libcudf to use any C++ exception -- including custom exceptions defined within libcudf -- and have these mapped to appropriate Java or Python exceptions. #12426 also demonstrated how such a custom exception could be defined, introducing cudf::data_type_error. The purpose of this issue is to serve as tracking for the task of systematically converting libcudf to throw better exceptions.

Describe the solution you'd like
I propose that we tackle this task on a file-by-file basis. This issue can serve as a tracker for which files have been updated as well as the definitive source of what exceptions libcudf throws under what circumstances. For each file, a developer would go through each CUDF_EXPECTS/CUDF_FAIL call and see if there is a suitable alternative to cudf::logic_error. If none currently exists, developers should propose a new exception and explain situations in which it should be used in a new issue. If the proposal is accepted, the table of exceptions below should be updated.

Table of exceptions:

Exception Description Issue Status
std::invalid_argument A function parameter is provided a value that is invalid in the given context. #10632 ✅ by #12426
cudf::data_type_error A function is called with a column or scalar with a data_type for which the function is invalid. A common example is in the default SFINAE overloads of type-dispatched functions. #10632 ✅ by #12426
std::overflow_error The output column corresponding to the input has size exceeds cudf limit. #12925 #13323
std::out_of_range An index argument or range includes indices that are out of bounds for the column being selected #15315 Some work in #15319

List of files to be updated (please add new lines to the task list when a file is updated):

@vyasr vyasr added feature request New feature or request Needs Triage Need team to review and classify labels Mar 6, 2023
@GregoryKimball GregoryKimball added 0 - Backlog In queue waiting for assignment code quality libcudf Affects libcudf (C++/CUDA) code. 2 - In Progress Currently a work in progress and removed Needs Triage Need team to review and classify 0 - Backlog In queue waiting for assignment labels Apr 2, 2023
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
2 - In Progress Currently a work in progress feature request New feature or request libcudf Affects libcudf (C++/CUDA) code.
Projects
Status: In Progress
Development

No branches or pull requests

2 participants