Skip to content

Commit

Permalink
Use existing _is_annotated_type
Browse files Browse the repository at this point in the history
  • Loading branch information
cswartzvi committed Feb 10, 2025
1 parent fc5f3c5 commit d97d145
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hamilton/htypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def get_type_as_string(type_: Type) -> Optional[str]:
:return: string representation of the type. An empty string if everything fails.
"""

if typing.get_origin(type_) is Annotated: # differs from typing_inspect.get_origin
if _is_annotated_type(type_):
type_string = get_type_as_string(typing.get_args(type_)[0])
elif getattr(type_, "__name__", None):
type_string = type_.__name__
Expand Down

0 comments on commit d97d145

Please sign in to comment.