summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/requirements.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-11-08 12:20:23 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2021-11-17 18:21:48 -0500
commit93fad8fb0c5421ad162064e0aa506cb1e70cbf2b (patch)
tree6566691a17686e206864856f30d46f6b0982be53 /lib/sqlalchemy/testing/requirements.py
parent958f902b1fc528fed0be550bc573545de47ed854 (diff)
downloadsqlalchemy-93fad8fb0c5421ad162064e0aa506cb1e70cbf2b.tar.gz
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
Diffstat (limited to 'lib/sqlalchemy/testing/requirements.py')
-rw-r--r--lib/sqlalchemy/testing/requirements.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py
index 4cc431bb7..56df452a5 100644
--- a/lib/sqlalchemy/testing/requirements.py
+++ b/lib/sqlalchemy/testing/requirements.py
@@ -957,6 +957,21 @@ class SuiteRequirements(Requirements):
return exclusions.open()
@property
+ def numeric_received_as_decimal_untyped(self):
+ """target backend will return result columns that are explicitly
+ against NUMERIC or similar precision-numeric datatypes (not including
+ FLOAT or INT types) as Python Decimal objects, and not as floats
+ or ints, including when no SQLAlchemy-side typing information is
+ associated with the statement (e.g. such as a raw SQL string).
+
+ This should be enabled if either the DBAPI itself returns Decimal
+ objects, or if the dialect has set up DBAPI-specific return type
+ handlers such that Decimal objects come back automatically.
+
+ """
+ return exclusions.open()
+
+ @property
def nested_aggregates(self):
"""target database can select an aggregate from a subquery that's
also using an aggregate