lidavidm commented on a change in pull request #11358:
URL: https://github.com/apache/arrow/pull/11358#discussion_r744889031
##########
File path: cpp/src/arrow/compute/kernels/scalar_string_test.cc
##########
@@ -1757,6 +1758,24 @@ TYPED_TEST(TestStringKernels, Strptime) {
std::string output1 = R"(["2020-05-01", null, "1900-12-11"])";
StrptimeOptions options("%m/%d/%Y", TimeUnit::MICRO);
this->CheckUnary("strptime", input1, timestamp(TimeUnit::MICRO), output1,
&options);
+
+ input1 = R"(["5/1/2020 %z", null, "12/11/1900 %z"])";
+ options.format = "%m/%d/%Y %%z";
+ this->CheckUnary("strptime", input1, timestamp(TimeUnit::MICRO), output1,
&options);
+}
+
+TYPED_TEST(TestStringKernels, StrptimeZoneOffset) {
+ if (!arrow::internal::kStrptimeSupportsZone) {
+ GTEST_SKIP() << "strptime does not support %z on this platform";
+ }
+ // N.B. BSD strptime only supports (+/-)HHMM and not the wider range
+ // of values GNU strptime supports.
+ std::string input1 = R"(["5/1/2020 +0100", null, "12/11/1900 -0130"])";
Review comment:
A couple things here:
- BSD strptime doesn't support "Z" as noted in the comment. It only supports
the syntax here, making it hard to test.
- The result type is based on the presence of a "%z" so that's covered here
already.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]