pitrou commented on code in PR #48601:
URL: https://github.com/apache/arrow/pull/48601#discussion_r2737403075


##########
python/pyarrow/tests/test_compute.py:
##########
@@ -2383,7 +2383,17 @@ def test_strftime():
                 result = pc.strftime(tsa, options=options)
                 # cast to the same type as result to ignore string vs 
large_string
                 expected = pa.array(ts.strftime(fmt)).cast(result.type)
-                assert result.equals(expected)
+                if sys.platform == "win32" and fmt == "%Z":
+                    # TODO(GH-48767): On Windows, std::chrono returns GMT 
offset
+                    # instead of timezone abbreviations (e.g. "CET")
+                    # https://github.com/apache/arrow/issues/48767
+                    is_valid = pc.or_kleene(pc.match_substring_regex(
+                        result, "^(UTC|GMT[+-][0-9]+)$"), pc.is_null(result))
+                    assert not pc.any(pc.invert(is_valid)).as_py(), \
+                        "All timezone values should be GMT offset format or 
UTC" \
+                        f"\nActual: {result}"

Review Comment:
   Can you make this less... complicated? Also put it in a helper function, 
because it's being duplicated.
   
   Edit: well, almost duplicated. But in case, it can certainly be made less 
complicated...



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