ShivanshhhG commented on code in PR #54684:
URL: https://github.com/apache/arrow/pull/54684#discussion_r4419826367


##########
cpp/src/arrow/compute/kernels/scalar_temporal_unary.cc:
##########
@@ -1198,6 +1198,28 @@ Result<std::locale> GetLocale(const std::string& locale) 
{
   }
 }
 
+// Check if format string contains %z, %Ez, or (optionally) %Z
+static inline bool FormatHasZone(std::string_view format, bool 
include_zone_name = true) {
+  size_t cur = 0;
+  size_t count = 0;
+  while (cur < format.size() - 1) {

Review Comment:
   Good catch on the underflow for empty strings! Updated to `cur + 1 < 
format.size()` and added empty format tests for both strftime and strptime.



-- 
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]

Reply via email to