From 93fad8fb0c5421ad162064e0aa506cb1e70cbf2b Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 8 Nov 2021 12:20:23 -0500 Subject: remove "native decimal" warning Removed the warning that emits from the :class:`_types.Numeric` type about DBAPIs not supporting Decimal values natively. This warning was oriented towards SQLite, which does not have any real way without additional extensions or workarounds of handling precision numeric values more than 15 significant digits as it only uses floating point math to represent numbers. As this is a known and documented limitation in SQLite itself, and not a quirk of the pysqlite driver, there's no need for SQLAlchemy to warn for this. The change does not otherwise modify how precision numerics are handled. Values can continue to be handled as ``Decimal()`` or ``float()`` as configured with the :class:`_types.Numeric`, :class:`_types.Float` , and related datatypes, just without the ability to maintain precision beyond 15 significant digits when using SQLite, unless alternate representations such as strings are used. Fixes: #7299 Change-Id: Ic570f8107177dec3ddbe94c7b43f40057b03276a --- lib/sqlalchemy/sql/sqltypes.py | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/sqltypes.py b/lib/sqlalchemy/sql/sqltypes.py index 559946072..52033f586 100644 --- a/lib/sqlalchemy/sql/sqltypes.py +++ b/lib/sqlalchemy/sql/sqltypes.py @@ -490,16 +490,6 @@ class Numeric(_LookupExpressionAdapter, TypeEngine): # we're a "numeric", DBAPI will give us Decimal directly return None else: - util.warn( - "Dialect %s+%s does *not* support Decimal " - "objects natively, and SQLAlchemy must " - "convert from floating point - rounding " - "errors and other issues may occur. Please " - "consider storing Decimal numbers as strings " - "or integers on this platform for lossless " - "storage." % (dialect.name, dialect.driver) - ) - # we're a "numeric", DBAPI returns floats, convert. return processors.to_decimal_processor_factory( decimal.Decimal, -- cgit v1.2.1