This is an automated email from the ASF dual-hosted git repository.
raulcd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 50eb001b13 GH-50041: [CI][Python] Make
test_string_to_tzinfo_pytz_fallback more robust for platforms supporting lower
case tz names (#50042)
50eb001b13 is described below
commit 50eb001b1306a2ed2f95bb6d36dcdb823d0486a9
Author: Joris Van den Bossche <[email protected]>
AuthorDate: Tue May 26 17:29:40 2026 +0200
GH-50041: [CI][Python] Make test_string_to_tzinfo_pytz_fallback more robust
for platforms supporting lower case tz names (#50042)
### Rationale for this change
Fix failing test on CI as reported in
https://github.com/apache/arrow/issues/50041, for a test added in
https://github.com/apache/arrow/pull/49694
### What changes are included in this PR?
The test relies on the lower case "europe/brussels" time zone name not
being recognized by `zoneinfo` (and it generally is by `pytz`). But apparently
on some platforms, `zoneinfo` does accept this. Updating the test to first test
this, and thus skip the test dynamically.
* GitHub Issue: #50041
Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Raúl Cumplido <[email protected]>
---
python/pyarrow/tests/test_types.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/python/pyarrow/tests/test_types.py
b/python/pyarrow/tests/test_types.py
index 4a33d79223..9b5c5efe1c 100644
--- a/python/pyarrow/tests/test_types.py
+++ b/python/pyarrow/tests/test_types.py
@@ -511,11 +511,16 @@ def test_string_to_tzinfo_prefer_zoneinfo_false():
assert result == pytz.FixedOffset(90)
[email protected](
- sys.platform == 'darwin', reason="macOS supports those lower-case names"
-)
def test_string_to_tzinfo_pytz_fallback():
pytz = pytest.importorskip("pytz")
+
+ try:
+ zoneinfo.ZoneInfo("europe/brussels")
+ except zoneinfo.ZoneInfoNotFoundError:
+ pass
+ else:
+ pytest.skip("zoneinfo supports lower-case names on this platform")
+
result = pa.lib.string_to_tzinfo("europe/brussels")
expected = pytz.timezone("Europe/Brussels")
assert result == expected