mixer icon indicating copy to clipboard operation
mixer copied to clipboard

Mixer should respect decimal presision on SQLAlchemy models

Open pax0r opened this issue 2 years ago • 0 comments

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.

pax0r avatar Aug 10 '22 12:08 pax0r