maartenbreddels commented on a change in pull request #7656:
URL: https://github.com/apache/arrow/pull/7656#discussion_r451431253
##########
File path: python/pyarrow/tests/test_compute.py
##########
@@ -95,6 +95,56 @@ def test_binary_contains_exact():
assert expected.equals(result)
+# utf8proc claims 0x8be is UTF8PROC_CATEGORY_LO
+utf8proc_issue_isalpha = {0x8be, 0x8bf, 0x8c0, 0x8c1, 0x8c2, 0x8c3, 0x8c4,
0x8c5, 0x8c6, 0x8c7, 0xd04, 0xe86, 0xe89, 0xe8c, 0xe8e, 0xe8f, 0xe90, 0xe91,
0xe92, 0xe93, 0xe98, 0xea0, 0xea8, 0xea9, 0xeac, 0x1cf2, 0x1cf3, 0x1cfa,
0x31bb, 0x31bc, 0x31bd, 0x31be, 0x31bf, 0x4db6, 0x4db7, 0x4db8, 0x4db9, 0x4dba,
0x4dbb, 0x4dbc, 0x4dbd, 0x4dbe, 0x4dbf, 0x9ff0, 0x9ff1, 0x9ff2, 0x9ff3, 0x9ff4,
0x9ff5, 0x9ff6, 0x9ff7, 0x9ff8, 0x9ff9, 0x9ffa, 0x9ffb, 0x9ffc, 0xa7ba, 0xa7bb,
0xa7bc, 0xa7bd, 0xa7be, 0xa7bf, 0xa7c2, 0xa7c3, 0xa7c4, 0xa7c5, 0xa7c6, 0xa7c7,
0xa7c8, 0xa7c9, 0xa7ca, 0xa7f5, 0xa7f6, 0xab66, 0xab67, 0xab68, 0xab69,
0x10e80, 0x10e81, 0x10e82, 0x10e83, 0x10e84, 0x10e85, 0x10e86, 0x10e87,
0x10e88, 0x10e89,
Review comment:
I've just pushed changes on this. We'd like to see how the Python and
Arrow implementations match since this is going to be used as an alternative
for the Python implementation. It runs really fast, so performance is not an
issue.
##########
File path: cpp/src/arrow/compute/kernels/scalar_string_test.cc
##########
@@ -145,8 +145,148 @@ TYPED_TEST(TestStringKernels, Utf8Lower) {
CallFunction("utf8_lower", {invalid_input}));
}
+TYPED_TEST(TestStringKernels, IsAlphaNumericUnicode) {
+ // U+08BE (utf8: \xE0\xA2\xBE) is undefined, but utf8proc things it is
+ // UTF8PROC_CATEGORY_LO
+ this->CheckUnary("string_isalnum_unicode", "[\"ⱭɽⱤoW123\", null, \"Ɑ2\",
\"!\", \"\"]",
+ boolean(), "[true, null, true, false, false]");
+}
+
+TYPED_TEST(TestStringKernels, IsAlphaUnicode) {
+ // U+08BE (utf8: \xE0\xA2\xBE) is undefined, but utf8proc things it is
+ // UTF8PROC_CATEGORY_LO
+ this->CheckUnary("string_isalpha_unicode", "[\"ⱭɽⱤoW\", null, \"Ɑ2\", \"!\",
\"\"]",
+ boolean(), "[true, null, false, false, false]");
+}
+
+TYPED_TEST(TestStringKernels, IsAscii) {
+ this->CheckUnary("binary_isascii", "[\"azAZ~\", null, \"Ɑ\", \"\"]",
boolean(),
+ "[true, null, false, true]");
+}
+
+TYPED_TEST(TestStringKernels, IsDecimalUnicode) {
+ // ٣ is arabic 3 (decimal), Ⅳ roman (non-decimal)
+ this->CheckUnary("string_isdecimal_unicode",
+ "[\"12\", null, \"٣\", \"Ⅳ\", \"1a\", \"\"]", boolean(),
+ "[true, null, true, false, false, false]");
+}
+
+TYPED_TEST(TestStringKernels, IsNumericUnicode) {
+ // ٣ is arabic 3 (decimal), Ⅳ roman (non-decimal)
+ this->CheckUnary("string_isnumeric_unicode",
+ "[\"12\", null, \"٣\", \"Ⅳ\", \"1a\", \"\"]", boolean(),
+ "[true, null, true, true, false, false]");
+}
+
+TYPED_TEST(TestStringKernels, IsLowerUnicode) {
+ // ٣ is arabic 3 (decimal), Φ capital
+ this->CheckUnary("string_islower_unicode",
+ "[\"12\", null, \"٣a\", \"٣A\", \"1a\", \"Φ\", \"\"]",
boolean(),
Review comment:
added
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]