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 177ec45c0b GH-47778: [CI][Python] Remove ORC alias timezone for 
US/Pacific on test_orc.py::test_timezone_absent (#47956)
177ec45c0b is described below

commit 177ec45c0b4fc406c545570fea344129c9d735e1
Author: Raúl Cumplido <[email protected]>
AuthorDate: Mon Oct 27 18:10:18 2025 +0100

    GH-47778: [CI][Python] Remove ORC alias timezone for US/Pacific on 
test_orc.py::test_timezone_absent (#47956)
    
    ### Rationale for this change
    
    Since we upgraded to ORC 2.1.1 our test started failing because it was able 
to resolved the timezone and read the file when we were expecting an exception 
to be raised.
    
    In order to support Legacy timezones ORC added some aliases to some 
timezones, in the case of our test `US/Pacific` was aliased to 
`America/Los_Angeles` and the test was finding the timezone.
    
    ### What changes are included in this PR?
    
    Remove both timezones `US/Pacific` and `America/Los_Angeles` so the test 
works as expected.
    
    ### Are these changes tested?
    
    Yes, locally via CI and some extra archery tasks
    
    ### Are there any user-facing changes?
    
    No
    
    * GitHub Issue: #47778
    
    Authored-by: Raúl Cumplido <[email protected]>
    Signed-off-by: Raúl Cumplido <[email protected]>
---
 python/pyarrow/tests/test_orc.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/python/pyarrow/tests/test_orc.py b/python/pyarrow/tests/test_orc.py
index 706fb3fe45..27154a6f34 100644
--- a/python/pyarrow/tests/test_orc.py
+++ b/python/pyarrow/tests/test_orc.py
@@ -177,7 +177,12 @@ def test_timezone_absent(datadir, tmpdir):
         shutil.copytree(source_tzdir, tzdir, symlinks=True)
     except OSError as e:
         pytest.skip(f"Failed to copy timezone database: {e}")
+    # ORC 2.1.1 Creates an alias between some legacy Timezones
+    # https://github.com/apache/orc/pull/2422
+    # Example US/Pacific -> America/Los_Angeles
+    # Remove both to simulate missing timezone and avoid alias resolution
     (tzdir / 'US' / 'Pacific').unlink(missing_ok=True)
+    (tzdir / 'America' / 'Los_Angeles').unlink(missing_ok=True)
 
     path = datadir / 'TestOrcFile.testDate1900.orc'
     code = f"""if 1:
@@ -189,7 +194,8 @@ def test_timezone_absent(datadir, tmpdir):
         try:
             orc_file.read()
         except Exception as e:
-            assert "zoneinfo/US/Pacific" in str(e), e
+            timezones = ["zoneinfo/US/Pacific", "zoneinfo/America/Los_Angeles"]
+            assert any(tz in str(e) for tz in timezones), e
         else:
             assert False, "Should have raised exception"
     """

Reply via email to