Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hamilton/function_modifiers/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,8 +854,8 @@ def save_json_data(data: pd.DataFrame, json_path: str = "data/my_saved_data.json

def validate(self, fn: Callable):
"""Validates that the function output is a dict type."""
return_annotation = inspect.signature(fn).return_annotation
if return_annotation is inspect.Signature.empty:
return_annotation = typing.get_type_hints(fn)["return"]
if return_annotation is None:
raise InvalidDecoratorException(
f"Function: {fn.__qualname__} must have a return annotation."
)
Expand Down
2 changes: 2 additions & 0 deletions tests/function_modifiers/test_adapters.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import dataclasses
from collections import Counter
from typing import Any, Collection, Dict, List, Tuple, Type
Expand Down