File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ Changed
1919^^^^^^^
2020- Switched from ``setup.cfg `` to ``pyproject.toml `` for configuration.
2121- Removed ``build_sphinx `` from ``setup.py `` and documented how to build.
22+ - Include enum members in error when invalid value is given
23+ `pytorch-lightning#17247
24+ <https://github.com/Lightning-AI/lightning/issues/17247> `__.
2225
2326
2427v4.20.1 (2023-03-30)
Original file line number Diff line number Diff line change @@ -611,12 +611,12 @@ def adapt_typehints(
611611 val = val .name
612612 else :
613613 if val not in typehint .__members__ :
614- raise_unexpected_value (f'Expected a member of { typehint } ' , val )
614+ raise_unexpected_value (f'Expected a member of { typehint } : { iter_to_set_str ( typehint . __members__ ) } ' , val )
615615 elif not serialize and not isinstance (val , typehint ):
616616 try :
617617 val = typehint [val ]
618618 except KeyError as ex :
619- raise_unexpected_value (f'Expected a member of { typehint } ' , val , ex )
619+ raise_unexpected_value (f'Expected a member of { typehint } : { iter_to_set_str ( typehint . __members__ ) } ' , val , ex )
620620
621621 # Type
622622 elif typehint in {Type , type } or typehint_origin in {Type , type }:
You can’t perform that action at this time.
0 commit comments