We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Annotated
1 parent 7f4bc66 commit ace24a3Copy full SHA for ace24a3
hamilton/htypes.py
@@ -99,7 +99,9 @@ def get_type_as_string(type_: Type) -> Optional[str]:
99
:return: string representation of the type. An empty string if everything fails.
100
"""
101
102
- if getattr(type_, "__name__", None):
+ if typing.get_origin(type_) is Annotated: # differs from typing_inspect.get_origin
103
+ type_string = get_type_as_string(typing.get_args(type_)[0])
104
+ elif getattr(type_, "__name__", None):
105
type_string = type_.__name__
106
elif typing_inspect.get_origin(type_):
107
base_type = typing_inspect.get_origin(type_)
0 commit comments