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
1 change: 1 addition & 0 deletions hamilton/function_modifiers/expanders.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ def _determine_fields_to_extract(
for field in fields:
if field not in typed_dict_fields:
errors.append(f"{field} is not a field in the `TypedDict` {output_type}.")
continue
reduced_fields[field] = typed_dict_fields[field]
fields = reduced_fields
elif isinstance(fields, dict):
Expand Down
1 change: 1 addition & 0 deletions tests/function_modifiers/test_expanders.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ def function() -> return_type: # type: ignore
("np.ndarray", {"A": int}),
("pd.DataFrame", {"A": int}),
("MyDictBad", {"A": int}),
("MyDict", (["test", "not_a_field"])),
("MyDictInheritanceBadCase", {"A": SomeObject}),
("dict", ("A", "B")),
("dict", (["A", "B"])),
Expand Down