Skip to content
Closed
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
2 changes: 1 addition & 1 deletion hamilton/function_modifiers/adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ def validate(self, fn: Callable):
f"Function: {fn.__qualname__} must have a return annotation."
)
origin = typing.get_origin(return_annotation)
if return_annotation is not dict and origin is not dict:
if return_annotation not in (dict, Dict, "dict", "dict_") and origin not in (dict, Dict, "dict", "dict_"):
raise InvalidDecoratorException(f"Function: {fn.__qualname__} must return a dict.")

def generate_nodes(self, fn: Callable, config) -> list[node.Node]:
Expand Down
1 change: 1 addition & 0 deletions tests/function_modifiers/test_adapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from __future__ import annotations

import dataclasses
from collections import Counter
Expand Down