PandasSchema icon indicating copy to clipboard operation
PandasSchema copied to clipboard

Allow custom msg arg passed to All Validation classes

Open happyshows opened this issue 5 years ago • 1 comments

Please add additional msg and print toggle args to print issues better.

For example, regular user will not be able to understand what regex pattern means, it could be challenging for even advanced users too when it gets complex. Be able to print additional description of regex expr will help users to understand why it fails.

pattern only
{row: 9658, column: "AccountNumber"}: "Dummy" does not match the pattern "^\d{3,7}$"
vs both
{row: 9658, column: "AccountNumber"}: "Dummy" does not match the pattern "^\d{3,7}$"
which checks for "3 to 7 digits"
vs msg only
{row: 9658, column: "AccountNumber"}: "Dummy" does not pass the check for "3 to 7 digits"

happyshows avatar May 02 '19 17:05 happyshows

Hmm, this is a reasonable request. At the moment you can always inherit from a given validation and override the default_message property, but ideally you won't have to do that for normal use. I think I would be happy to add a custom message property to the Validation class.

multimeric avatar May 03 '19 00:05 multimeric