(result, expected)
| 2526 | |
| 2527 | |
| 2528 | def _compare_strftime_strings_on_windows(result, expected): |
| 2529 | # TODO(GH-48767): On Windows, std::chrono returns GMT offset |
| 2530 | # instead of timezone abbreviations (e.g. "CET") |
| 2531 | # https://github.com/apache/arrow/issues/48767 |
| 2532 | |
| 2533 | # Match timezone suffixes (UTC), offsets (GMT+1), or abbreviations (CET) |
| 2534 | p = "(UTC|GMT[+-]?[0-9]*|[A-Z]{2,5})$" |
| 2535 | |
| 2536 | ends_with_tz = pc.match_substring_regex(result, p) |
| 2537 | all_end_with_tz = pc.all(ends_with_tz, skip_nulls=True).as_py() |
| 2538 | assert all_end_with_tz, "All timezone values should be GMT offset format, "\ |
| 2539 | f"UTC, or timezone abbreviation\nActual: {result}" |
| 2540 | |
| 2541 | result_substring = pc.replace_substring_regex(result, pattern=p, replacement="") |
| 2542 | expected_substring = pc.replace_substring_regex(expected, pattern=p, replacement="") |
| 2543 | assert result_substring.equals(expected_substring), \ |
| 2544 | f"Expected: {expected}, \nActual: {result} " \ |
| 2545 | "\nNote: tz suffix is not being compared" |
| 2546 | |
| 2547 | |
| 2548 | @pytest.mark.pandas |
no test coverage detected