I want to insert values into a table (MySQL), where a field is defined as
Column('profit', DECIMAL(8, 2), nullable=False)
The values being inserted are Python floats (stored in a DataFrame
, from Pandas library). When I do this with SQLAlchemy, I'm getting a warning:
Warning: Data truncated for column 'profit' at row 124
What do I have to do to avoid this warning? I don't see a way to use Python's Decimal
class here because the table may contain decimals with different precision, baring that any operation on instances of this class will be very slow and far too cumbersome.