Skip to content

Commit c405100

Browse files
committed
Fix type hint for mapping result
1 parent c632953 commit c405100

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/odin/mapping/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ def apply(
501501
source_obj,
502502
context=None,
503503
allow_subclass: bool = False,
504-
mapping_result: MappingResult = None,
504+
mapping_result: Type[MappingResult] = None,
505505
):
506506
"""
507507
Apply conversion either a single resource or a list of resources using the mapping defined by this class.
@@ -621,11 +621,13 @@ def _apply_rule(self, mapping_rule):
621621
except TypeError as ex:
622622
raise MappingExecutionError(
623623
f"{ex} applying rule {mapping_rule}"
624-
) from None
624+
) from ex
625625

626626
if to_list:
627627
if isinstance(to_values, Iterable):
628628
to_values = (list(to_values),)
629+
else:
630+
to_values = (to_values,)
629631
else:
630632
to_values = force_tuple(to_values)
631633

0 commit comments

Comments
 (0)