-
Notifications
You must be signed in to change notification settings - Fork 889
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
Add except declaration in Cython interface for regex_program::create #13054
Add except declaration in Cython interface for regex_program::create #13054
Conversation
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.
Changes look good. Should we add a test?
Proposed test: def test_invalid_regex():
s = cudf.Series(["a"])
with pytest.raises(RuntimeError): # Might be the wrong error class, please verify
s.str.extract("{\}") # Should this be a raw string like `r"{\}"`? |
Yes, thanks. |
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, pending @bdice's suggestions for testing
I think that’d be fine. I am not up to date on the latest guidelines / changes for exception types so I don’t know exactly what to recommend. I know we’ve been pushing to improve that recently. |
/merge |
Description
Add the
except +
declaration to thecudf::strings::regex_program::create()
function in the Cythonregex_program.pxd
interface since invalid regex patterns are thrown by this call. This allows the normal Cython exception handling to pass the exception to the Python logic without aborting the process.Closes #13052
Checklist