arrow icon indicating copy to clipboard operation
arrow copied to clipboard

[Python][CI] Failing test_dateutil_tzinfo_to_string due to new release of python-dateutil

Open AlenkaF opened this issue 2 years ago • 7 comments

Describe the bug, including details regarding any error messages, version, and platform.

test_dateutil_tzinfo_to_string started failing with:

         tz = dateutil.tz.gettz('Europe/Paris')
>       assert pa.lib.tzinfo_to_string(tz) == 'Europe/Paris'
E       AssertionError: assert 'Europe/Monaco' == 'Europe/Paris'
E         - Europe/Paris
E         + Europe/Monaco

see: https://github.com/ursacomputing/crossbow/actions/runs/8103088008/job/22164107523#step:6:4305.

This is most probably due to new release of python-dateutil package.

The test is failing on the CI now also, with dateutil 2.9.0: https://ci.appveyor.com/project/ApacheSoftwareFoundation/arrow/builds/49322144?fullLog=true

Upstream issue: https://github.com/dateutil/dateutil/issues/1353

Component(s)

Continuous Integration, Python

AlenkaF avatar Mar 04 '24 11:03 AlenkaF

cc @raulcd

AlenkaF avatar Mar 04 '24 11:03 AlenkaF

I can't reproduce this on Linux, so most probably a Windows issue (or related to the exact tzdata being used there, since for me locally it's using the system provided data)

Might be good to report upstream?

jorisvandenbossche avatar Mar 04 '24 12:03 jorisvandenbossche

The logic we use to convert a dateutil tz to a string:

https://github.com/apache/arrow/blob/2b194ad222f4dc8ecf2eb73539ab8cab5b1fc5e7/python/pyarrow/src/arrow/python/datetime.cc#L554-L568

(so it might also be that something changed under the hood in dateutil that messes that u. It would be good to verify if the actual tz object in the snippet above, before conversion to a string by pyarrow, also shows "Europe/Monaco")

jorisvandenbossche avatar Mar 04 '24 12:03 jorisvandenbossche

Agree with you Joris. I would first like to check the behaviour of dateutil, as you mention, but also can't do that on my M1. I could in any case open an issue upstream before, if we think that makes sense.

AlenkaF avatar Mar 04 '24 13:03 AlenkaF

The same issue is being reproduced on my PR on the conda feedstock on Windows: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=888527&view=logs&j=ab98fee7-5bc6-5c2f-a410-3ab9b2f2e8ca&t=472408ae-fc68-5791-981c-69ea41d2d692&l=38399

    def test_dateutil_tzinfo_to_string():
        pytest.importorskip("dateutil")
        import dateutil.tz
    
        tz = dateutil.tz.UTC
        assert pa.lib.tzinfo_to_string(tz) == 'UTC'
        tz = dateutil.tz.gettz('Europe/Paris')
>       assert pa.lib.tzinfo_to_string(tz) == 'Europe/Paris'
E       AssertionError: assert 'Europe/Monaco' == 'Europe/Paris'
E         - Europe/Paris
E         + Europe/Monaco

Edit: added on Windows

raulcd avatar Mar 04 '24 14:03 raulcd

A temporary skip was added in https://github.com/apache/arrow/pull/40486

jorisvandenbossche avatar Mar 12 '24 11:03 jorisvandenbossche

This was reported upstream: https://github.com/dateutil/dateutil/issues/1353

rok avatar Mar 19 '25 16:03 rok