Skip to content

Mixer should respect decimal presision on SQLAlchemy models #170

@pax0r

Description

@pax0r

I have model with field defined like this:
Column(sa.Numeric(precision=9, scale=3), nullable=False)
and I am trying to use Mixer to put data into that model.
Sometimes it tries to insert larger values than allowed by this field which results with error:

sqlalchemy.exc.DataError: Mixer (<class 'test.Model'>): (psycopg2.errors.NumericValueOutOfRange) numeric field overflow
DETAIL:  A field with precision 9, scale 3 must round to an absolute value less than 10^6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions