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
{{ message }}
Repository navigation
multipleOf validation throws DivisionImpossible error for Decimal class, if one of the operands is much bigger than the other. #701
Modulo operation between two instances of decimal.Decimal classes can throw an decimal.InvalidOperation: [<class 'decimal.DivisionImpossible'>] error if the bigger operand is 28 orders of magnitudes bigger than the other (for a % b we get an error if a > b * 10^28). Relevant stackoverflow thread.
I believe this exception should be caught and tried again with a better precision value. I understand that decimal.Decimal isn't used by json.load. Still, decimal.Decimal is being heavily used by Singer taps and targets for some reason.
That's something that should be done outside jsonschema -- as you say, jsonschema doesn't deserialize things. It supports Decimals if they've been loaded properly, but it's up to you to set their precision to what you need them to be before handing them to validation, jsonschema can't really know what precision is appropriate.
Activity
Julian commentedon Jul 7, 2020
That's something that should be done outside
jsonschema-- as you say,jsonschemadoesn't deserialize things. It supportsDecimals if they've been loaded properly, but it's up to you to set their precision to what you need them to be before handing them to validation,jsonschemacan't really know what precision is appropriate.Squashed 'json/' changes from d38ddd54..217bf81b
Squashed 'json/' changes from 83e866b4..ab3924a6
Squashed 'json/' changes from ab3924a6..9ad349be