From 8bfaf418de8a22bbfe97db14f81e44550176b848 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Sun, 26 May 2024 19:25:59 +0100 Subject: [PATCH] fix: Use 3.8 compatible `typing.Callable` over `collections.abc` --- altair/utils/_vegafusion_data.py | 3 +-- altair/utils/plugin_registry.py | 3 +-- altair/vegalite/data.py | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/altair/utils/_vegafusion_data.py b/altair/utils/_vegafusion_data.py index 7d108450d..770f796a2 100644 --- a/altair/utils/_vegafusion_data.py +++ b/altair/utils/_vegafusion_data.py @@ -1,6 +1,5 @@ import uuid from weakref import WeakValueDictionary - from typing import ( Any, Literal, @@ -13,8 +12,8 @@ Final, TYPE_CHECKING, overload, + Callable, ) -from collections.abc import Callable from altair.utils._importers import import_vegafusion from altair.utils.core import DataFrameLike diff --git a/altair/utils/plugin_registry.py b/altair/utils/plugin_registry.py index 7f6bf594a..b1cce92ec 100644 --- a/altair/utils/plugin_registry.py +++ b/altair/utils/plugin_registry.py @@ -1,7 +1,6 @@ from functools import partial -from typing import Any, Dict, List, Optional, Generic, TypeVar, Union, cast +from typing import Any, Dict, List, Optional, Generic, TypeVar, Union, cast, Callable from types import TracebackType -from collections.abc import Callable from importlib.metadata import entry_points diff --git a/altair/vegalite/data.py b/altair/vegalite/data.py index ed94b223a..8e8c5be0e 100644 --- a/altair/vegalite/data.py +++ b/altair/vegalite/data.py @@ -13,8 +13,7 @@ from ..utils.data import DataTransformerRegistry as _DataTransformerRegistry from ..utils.data import DataType, ToValuesReturnType from ..utils.plugin_registry import PluginEnabler -from typing import Optional, Literal, Union, overload -from collections.abc import Callable +from typing import Optional, Literal, Union, overload, Callable @overload