Closed RmZeta2718 closed 5 months ago
@lebrice, I was just about to make the same feature request.
If one makes a typo in a nested key - it just gets ignored and the default is used.
could simple-parsing plug https://github.com/pydantic/pydantic or something similar and provide a strict validation for all keys and values and not only the top-level ones?
This is currently a very big problem since if one makes a typo a whole training could be derailed and not noticed.
Thank you
Thanks for posting!
Hmm this is not intended to happen, good catch!
Hey there @RmZeta2718 @stas00 , sorry for the delay.
I believe this was fixed in #290. On the latest release (0.1.5) a RuntimeError
is raised when there is an unexpected kwarg in the config.
Could you please check if the latest release also fixes that for you? If not, could you perhaps share an example that isn't working (where no exception is raised?)
Thanks a lot!
Describe the bug Normally, parser should raise an error when unexpected keyword argument occurs. But when dataclasses are nested, it doesn't raise an error but simply omits the unexpected keyword argument.
To Reproduce
test.py
:config.yaml
:Expected behavior
Actual behavior Omits unexpected keyword argument 'b' and exit successfully:
Desktop (please complete the following information):