-
Notifications
You must be signed in to change notification settings - Fork 915
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
Change pattern parameter for regex APIs from std::string to std::string_view #10810
Change pattern parameter for regex APIs from std::string to std::string_view #10810
Conversation
Codecov Report
@@ Coverage Diff @@
## branch-22.06 #10810 +/- ##
================================================
+ Coverage 86.28% 86.31% +0.02%
================================================
Files 144 144
Lines 22654 22654
================================================
+ Hits 19548 19554 +6
+ Misses 3106 3100 -6
Continue to review full report at Codecov.
|
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.
🚀 Small, self-contained PRs 🚀
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.
One suggestion - otherwise echoing @jrhemstad: 🚀 Small self-contained PRs! 🚀
@gpucibot merge |
…ew (#10832) Follow on to #10810. This changes other occurrences of parameter type `std::string` to `std::string_view` in the non-regex APIs. This covers `cudf::strings::pad` fill-char and the to/from-timestamp/duration converters that accept format specifiers. Authors: - David Wendt (https://github.com/davidwendt) Approvers: - Mike Wilson (https://github.com/hyperbolic2346) - Bradley Dice (https://github.com/bdice) URL: #10832
The input string pattern does not require a heavy-weight
std::string
object but can accept astd::string_view
now that we compile with c++17 for libcudf and cython. Literal strings (null-terminated char array),std::string
andstd::string_view
objects can not be passed for thepattern
parameter on these APIs.https://docs.rapids.ai/api/libcudf/stable/group__strings__contains.html
Although Cython does not have a native
libcpp.string_view
representation, the Cython code works because thelibcpp.string
is automatically convertable to astd::string_view
. However, the multi-pattern versionreplace_re
could not be changed because Cython is unable to build astd::vector<std::string_view>
instance at this time.Likewise, the Java code's
std::string
pattern parameters are automatically converted tostd::string_view
instances.