Skip to content

multipleOf validation throws DivisionImpossible error for Decimal class, if one of the operands is much bigger than the other. #701

Closed
@emreakg

Description

@emreakg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions