From b7c982830149181a1cea744c49e270578877719b Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Thu, 26 Sep 2024 10:11:34 +0200 Subject: [PATCH 1/3] fix: Disable very old date in timezone test for CI --- .../unit/operations/namespaces/temporal/test_datetime.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/py-polars/tests/unit/operations/namespaces/temporal/test_datetime.py b/py-polars/tests/unit/operations/namespaces/temporal/test_datetime.py index 7dc5dfd8a9cc..94ba56639d28 100644 --- a/py-polars/tests/unit/operations/namespaces/temporal/test_datetime.py +++ b/py-polars/tests/unit/operations/namespaces/temporal/test_datetime.py @@ -1400,8 +1400,13 @@ def test_literal_from_date( @pytest.mark.parametrize( "value", [ - datetime(1677, 9, 22), - datetime(1677, 9, 22, tzinfo=ZoneInfo("EST")), + # Very old dates with a timezone like EST caused problems for the CI due + # to the IANA timezone database updating their historical offset, so + # these have been disabled for now. A mismatch between the timezone + # database that chrono_tz crate uses vs. the one that Python uses (which + # differs from platform to platform) will cause this to fail. + # datetime(1677, 9, 22), + # datetime(1677, 9, 22, tzinfo=ZoneInfo("EST")), datetime(1970, 1, 1), datetime(1970, 1, 1, tzinfo=ZoneInfo("EST")), datetime(2024, 2, 29), From 9cff9b984f6496fe3e18f99f3b118c33cc84f319 Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Thu, 26 Sep 2024 10:48:58 +0200 Subject: [PATCH 2/3] dbg in CI --- .../tests/unit/operations/namespaces/temporal/test_datetime.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/py-polars/tests/unit/operations/namespaces/temporal/test_datetime.py b/py-polars/tests/unit/operations/namespaces/temporal/test_datetime.py index 94ba56639d28..883f938ed5a2 100644 --- a/py-polars/tests/unit/operations/namespaces/temporal/test_datetime.py +++ b/py-polars/tests/unit/operations/namespaces/temporal/test_datetime.py @@ -1430,6 +1430,8 @@ def test_literal_from_datetime( value = value.replace(tzinfo=ZoneInfo(dtype.time_zone)) # type: ignore[union-attr] assert out.schema == OrderedDict({"literal": dtype}) + print(out.item()) + print(value) assert out.item() == value From 0ed765c948f4037f03e2c06e93afc7d1c9765643 Mon Sep 17 00:00:00 2001 From: Orson Peters Date: Thu, 26 Sep 2024 12:08:08 +0200 Subject: [PATCH 3/3] fix other test --- .../unit/operations/namespaces/temporal/test_datetime.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/py-polars/tests/unit/operations/namespaces/temporal/test_datetime.py b/py-polars/tests/unit/operations/namespaces/temporal/test_datetime.py index 883f938ed5a2..6bbd10828496 100644 --- a/py-polars/tests/unit/operations/namespaces/temporal/test_datetime.py +++ b/py-polars/tests/unit/operations/namespaces/temporal/test_datetime.py @@ -1367,7 +1367,7 @@ def test_dt_mean_deprecated() -> None: @pytest.mark.parametrize( "value", [ - date(1677, 9, 22), + # date(1677, 9, 22), # See test_literal_from_datetime. date(1970, 1, 1), date(2024, 2, 29), date(2262, 4, 11), @@ -1430,8 +1430,6 @@ def test_literal_from_datetime( value = value.replace(tzinfo=ZoneInfo(dtype.time_zone)) # type: ignore[union-attr] assert out.schema == OrderedDict({"literal": dtype}) - print(out.item()) - print(value) assert out.item() == value