diff --git a/dlt/common/typing.py b/dlt/common/typing.py index 05720fe7d9..bdd2b914dc 100644 --- a/dlt/common/typing.py +++ b/dlt/common/typing.py @@ -26,6 +26,7 @@ IO, Iterator, Generator, + cast, ) from typing_extensions import ( @@ -243,7 +244,7 @@ def get_all_types_of_class_in_union(hint: Type[Any], cls: Type[TAny]) -> List[Ty return [ t for t in get_args(hint) - if inspect.isclass(t) and (issubclass(t, cls) or issubclass(cls, t)) + if not is_typeddict(t) and inspect.isclass(t) and (issubclass(t, cls) or issubclass(cls, t)) ]