diff --git a/py-polars/tests/unit/functions/test_as_datatype.py b/py-polars/tests/unit/functions/test_as_datatype.py index 6ceebfb2745b..86fbb0fdfd14 100644 --- a/py-polars/tests/unit/functions/test_as_datatype.py +++ b/py-polars/tests/unit/functions/test_as_datatype.py @@ -1,6 +1,5 @@ from __future__ import annotations -import sys from datetime import date, datetime from typing import TYPE_CHECKING @@ -9,14 +8,12 @@ import polars as pl from polars.testing import assert_frame_equal, assert_series_equal -if sys.version_info >= (3, 9): - from zoneinfo import ZoneInfo -else: - # Import from submodule due to typing issue with backports.zoneinfo package: - # https://github.com/pganssle/zoneinfo/issues/125 - from backports.zoneinfo._zoneinfo import ZoneInfo if TYPE_CHECKING: + from zoneinfo import ZoneInfo + from polars.type_aliases import TimeUnit +else: + from polars.utils.convert import get_zoneinfo as ZoneInfo def test_date_datetime() -> None: