You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment all checks to validate output data are done using assert. It would be great if we could get these to throw a custom error (like ValidationError or some subclass of this) instead.
People often run python can be run with assertions disabled, and this would disable a key behavior in these functions. Worse still is that validation code would still quietly run and "pass" data with no indication that checks are not being performed.
This addition could also make it easier for people to catch and handle certain types of validation problems, with more helpful error messages.
The text was updated successfully, but these errors were encountered:
brews
changed the title
Validation checks should throw new ValidationError, not AssertionError
Validation checks should throw new ValidationFailed-like, not AssertionError
Mar 31, 2022
I've used ValidationError a couple times, but that also makes me feel like validation is throwing some unexpected error, not that it performed as it should and caught bad data... if that makes sense.
At the moment all checks to validate output data are done using
assert
. It would be great if we could get these to throw a custom error (likeValidationError
or some subclass of this) instead.People often run python can be run with assertions disabled, and this would disable a key behavior in these functions. Worse still is that validation code would still quietly run and "pass" data with no indication that checks are not being performed.
This addition could also make it easier for people to catch and handle certain types of validation problems, with more helpful error messages.
The text was updated successfully, but these errors were encountered: