diff --git a/py-polars/polars/dataframe/plotting.py b/py-polars/polars/dataframe/plotting.py index de8dfe900d3f..3dd35f34ec79 100644 --- a/py-polars/polars/dataframe/plotting.py +++ b/py-polars/polars/dataframe/plotting.py @@ -1,12 +1,19 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, Callable, Mapping, TypeAlias, Union +from typing import TYPE_CHECKING, Any, Callable, Mapping, Union if TYPE_CHECKING: + import sys + import altair as alt from polars import DataFrame + if sys.version_info >= (3, 10): + from typing import TypeAlias + else: + from typing_extensions import TypeAlias + ChannelType: TypeAlias = Union[str, Mapping[str, Any], Any]