File tree 2 files changed +5
-2
lines changed 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ Changed
19
19
^^^^^^^
20
20
- Switched from ``setup.cfg `` to ``pyproject.toml `` for configuration.
21
21
- 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> `__.
22
25
23
26
24
27
v4.20.1 (2023-03-30)
Original file line number Diff line number Diff line change @@ -611,12 +611,12 @@ def adapt_typehints(
611
611
val = val .name
612
612
else :
613
613
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 )
615
615
elif not serialize and not isinstance (val , typehint ):
616
616
try :
617
617
val = typehint [val ]
618
618
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 )
620
620
621
621
# Type
622
622
elif typehint in {Type , type } or typehint_origin in {Type , type }:
You can’t perform that action at this time.
0 commit comments