diff --git a/src/gt4sd/algorithms/registry.py b/src/gt4sd/algorithms/registry.py index 9597045fa..a6fb14dc0 100644 --- a/src/gt4sd/algorithms/registry.py +++ b/src/gt4sd/algorithms/registry.py @@ -28,7 +28,7 @@ from dataclasses import dataclass as vanilla_dataclass from dataclasses import field, make_dataclass from functools import WRAPPER_ASSIGNMENTS, update_wrapper -from typing import Any, Callable, ClassVar, Dict, List, NamedTuple, Optional, Type +from typing import Any, Callable, ClassVar, Dict, List, NamedTuple, Optional, Type, TypeVar import pydantic @@ -186,8 +186,7 @@ def decorator( ], # type: ignore ) # NOTE: Needed to circumvent a pydantic TypeError: Parameter list to Generic[...] cannot be empty - VanillaConfiguration.__pydantic_validator__ = True # type: ignore - + VanillaConfiguration.__parameters__ = (TypeVar('T'),) # NOTE: Duplicate call necessary for pydantic >=1.10.* - see https://github.com/pydantic/pydantic/issues/4695 PydanticConfiguration: Type[AlgorithmConfiguration] = dataclass( # type: ignore VanillaConfiguration